Best to lock down a great deal before cashing out. Paying those taxes will hurt. On the other hand it's why real estate is great because business expenses, and depreciation limit the tax liability every year.
I would still prefer to borrow over withdraw. If you withdraw you wont get much more than $50k anyway after taxes and penalties. If you withdraw you definitely pay the penalty, if you borrow you MAY have to pay the penalty.
Be aware the tax laws changed on this too. If you lose your job you have until the next tax returns are due before you are in default. So if you lost your job in July 2018 you have until October 2019 to pay back loan (with 6 month filing extension). That gives you over a year to get as much money as you can back into 401k.