What you propose does not avoid paying taxes on the money in the 401(k). You can use the funds that you obtain from a 401(k) to fund a Roth IRA contribution, but you'll pay interest to the 401(k) on the loan and all of the money that you pay back, including the interest, will still eventually be taxable when eventually distributed from the 401(k).
Given that tax rates are scheduled to return to higher levels in 2026, it might be better to pay taxes now on a Roth conversion rather than continue to defer taxes and to also pay interest. Of course that requires you to have a traditional account from which you can make a Roth conversion or rollover to a Roth account.