I was under the impression that if you aren't currently maxing out 401k/IRA, then it is mathematically the same to withdraw from HSA or to pay out-of-pocket for medical expenses and save receipts. Is that not the case?
If so, then the decision comes down to preference. Paying out-of-pocket and saving receipts can be a hassle, and HSA investment options aren't always as good as 401k options. On the other hand, not reimbursing leaves greater flexibility with investments in the future while still having ideal tax treatment.
You're right, not-withdrawing from HSA by saving receipts and withdrawing and contributing to Roth are (mostly) mathematically equivalent, but not PITA equivalent since you have to save receipts. I say "mostly" because gains in the HSA have to spent on medical expenses while gains in Roth can be spent on anything. This is mostly about preference though.
Leaving the money in HSA or moving the money to Roth are mathematically equivalent if you end up having big enough medical bills to spend the entire HSA balance. If you live long enough to be on Medicare for a while, those premiums will likely be sufficient to help you spend it down, assuming Medicare still has a premium when you're old enough to be on it, and assuming those premiums are still HSA-qualified expenses at the time.
If you die in a car crash or have a heart attack at 55 and don't survive long enough to make it to the hospital and incur big medical bills, then maybe you die with a pretty big HSA balance. What happens then? If you have a surviving spouse who you have designated as your HSA beneficiary, the HSA becomes theirs with no change in tax status. No problem there. If your beneficiary isn't your spouse, the entire balance becomes taxable income to your beneficiary in the year of your death. Compare this to a Roth IRA where the entire balance is tax-free to your beneficiary.
Furthermore it's not clear to me that your "saved receipts" would be of any use to a non-spouse beneficiary. The
IRS publication on the matter states that your beneficiary would be able to deduct any of your medical expenses that
they paid after your death from the amount that they would otherwise be taxed on from your HSA, but it doesn't say anything about expenses
you paid and failed to reimburse yourself for prior to your death.
Between the hassle of receipt tracking and the strictly worse tax treatment of inherited HSAs, I don't see a compelling reason not to transfer money from your HSA to your Roth if your Roth contribution space would otherwise go unused for the year and you have decided to prefer Roth retirement contributions over tax-deferred contributions.
However, the not-withdrawing/withdraw-Roth-contribute pair (which are mostly equivalent) are not equivalent to withdrawing and contributing to traditional. Contributing to traditional is usually preferable to contributing to Roth for most people.
I hesitate to make such a blanket statement ("traditional is usually preferable to Roth for most people") anymore. If you expect the ACA (or something like it that bases costs on income) to be around during your early retirement, then it's quite likely for someone to experience
higher marginal rates in retirement even if their income decreases by a substantial amount.