It's a fine fix but many companies don't pay for that so you're out $200+ a month in a large city. It also gets complicated if you take the home office deduction
Renting an office and sharing it with somebody is definitely worth the money from my experience. I used to live like that in Munich. Had an office with nice people 5 minutes bike ride away. Perfect!
Yeah, I've decided then that the 140EUR of costs per month were worth it in terms of mental health and motivation. The difference in rents between the company HQ and my city made up for it anyway.