These types of debt typically have low interest rates. Market returns for the past decade have exceeded the interest rates. Paying the minimums, and investing the difference? The consumer would be ahead. 12-15% YoY stock returns compound faster than 4% mortgage debt.
[0]: https://www.experian.com/blogs/ask-experian/research/consume...
Not all debt is equivalent: credit card debt and payday loans are examples of pretty punitive debt that really should be avoided. The return on investment from paying off debt is roughly equivalent from the interest on your debt; if it's lower than you can get by investing elsewhere, then it may make sense to invest elsewhere, especially when you factor in second-order effects like tax laws.
[1] For the record, I think the tax-advantaged nature of debt is absolutely inane and should be removed. But that is unlikely to be politically feasible.