A 401k loan would still be debt. I believe that the interest rate for such a loan would be 10%. I pay less interest on my auto loan and for my credit card. I looked into taking out a 401k loan to pay down the debt, then rolling my IRA into the 401k to repay the loan (avoiding the penalty and taxes) but that is not legal/allowed. You can't pay back a 401k loan with untaxed money.
You’d be getting rid of interest paid to a third party, and converting that to a higher rate of interest paid to yourself. I don’t see it as being as consequential as pulling it all out to pay down debt. Unless you have to default, that is. Even then, the consequence is no worse than what would be experienced from pulling it all out, unless I’m overlooking something.