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.
I had this issue as well, but managed to solve it by renting an office with a few of my remote working friends. This resulted in best-of-both-worlds: I could still go to the office to work with tech people (and grab coffee, lunch) while noone really cared if I came in. Also the city I was living in was decently small which meant 15 min "commute" with bike if I wished.