I think I’d just deal with the penalties and cash out, if possible.
If you smell blood in the water, I would recommend taking a hardship withdrawal. My advisor has warned me about touching my 401(k), but I explained to him that if the government passes reforms that tax or otherwise touch 401(k)s, he should be prepared for a glut of people asking that same question.
If you take a hardship, they assume you’ll pay it back, but if they get something passed that guts 401(k) savings, at least you’ve got your money before they can take it from you.
That’s my view on it, anyway.