I didn't read the thread, so sorry if I repeat answers. And sorry for your job loss, I hope you find a new job quickly.
I'd say it is best to avoid the 401k withdrawal. While there can be exceptions to avoid the 10% tax penalty, there are many other drawbacks to consider.
1) Think of the very worst case scenario, where you don't get a job for quite some time. Case (a) you withdraw your 401k, spend it all, file for bankruptcy and you have nothing. The bankruptcy got you whole again, but you are flat broke. Case (b) you don't touch the 401k, spend what you can, and file for bankruptcy. The bankruptcy got you whole again, but this time you still have ~$40,000 in your 401k that the bankruptcy can't touch. If the worst case scenario happens to you, leaving the 401k alone is a far better option.
2) There are plenty of resources to help you: unemployment, hardship prescription drug discounts, Medicaid, etc. You might not need the 401k money as much as you think. I'd seriously look into the free or reduced price prescription drug offerings. After going to unemployment and then applying for government benefits, then go to the drug manufacturer. There are 3rd party assistance programs for the drugs, but why not try the manufacturer directly (no middle men to get in the way). Many of these programs (such as free or reduced price prescription drugs from the manufacturer) require a low income. If you withdraw your 401k, that is considered income for this year and you might not qualify.
3) You probably have other options that come before the last resort 401k withdrawal. Can you get to some of your home equity or even sell your home? Can you borrow from family? Can you live off of credit cards? Even at a ~20% credit card interest rate, you'll be charged a lot less with credit card interest than with tax penalties or with other options in the short or medium term job loss situations. Borrowing $25k for a year from credit cards costs ~$2700 assuming you borrow it as you need it. Getting $25k from selling a house costs about $10k in realtor fees (widely varying on your house value of course). If you have to pay the 10% fee on a ~$40k 401K withdrawal it will cost you $4k. For the short term borrowing need, the credit card is the cheapest route. For long term needs, see bankruptcy above. Heck, if you can get back on your feet after a year, your 401K will likely earn more on stock gains (~$3200 at 8% gains) than the CC interest will cost (~$2700).