“So long term, it doesnt cost the government any tax revenue, because the taxes are paid on the back end, not year by year.”
If you die with 401K money, your beneficiaries avoid tax on gains altogether.
If you die, the heirs pay tax on what they get unless they roll it over into a survivor Ira. I think they pay income tax on what they don’t roll over. Not cap gains.
If it is a tax deferred 401K, they pay taxes. If it is a Roth 401K then they don't. But they have to withdraw the money withinn 5 years if my memory serves me correctly..