I'm going to research this scenario.
I did a 401k loan (first time) and might quit before repaying it. The freedom of having money allowed me to buy my retirement home early and am under contract to sell the clown house. No closing costs, pmi,mortgage interest, saved bazillion.
The choice going forward would be refinance into a typical loan and repay 401k. BUT YUCK. That doesn't make sense from a cost standpoint.
So I realize the cost comparison must include the early withdrawal penalties and loss of growth. And (help fill in the rest). But keeping the house paid off will allow us to pursue more satisfying work instead of chasing money for housing expenses.