10 years ago on NYE at Times Square, people were literally dropping squat or pissing in bottles in the middle of a televised street for lack of anywhere else to do it. I've been desperate enough to have to to it myself.
Somewhere in the suburbs? Sure, just stop at a McDonald's, a public park, a mall, or any number of places with toilet access. But cities themselves largely lack them.
There were portapotties stationed up and down the strip...outside of the corrals. If you dared to use them, you were done for the night-- you couldn't get back into your pen unless you evaded the cops and hopped a fence.
Like you said, find a restaurant, or a Dunking Donuts and buy something...or just sneak in. Look at the menu up as you're thinking and then run to the bathroom. At the places I usually is it I don't feel guilty, if I ate there yesterday I paid for today's bathroom use :)
Public bathrooms are a lot of trouble with cleaning, crime etc and usually are closed at nighttime in parks too. Tech can mitigate some of those concerns but still...
Now to your point: Almost all businesses in the US allow people to use the restroom without buying merchandise or food, unless marked specifically. The places that don't allow it are typically in high traffic tourist areas that already have public facilities, or otherwise have a homeless problem that has them needing to keep their facilities from being abused.
Gas stations are required by the state to have publicly accessible bathrooms (and have also long decided this is good business).
Pretty much any place with seating will have bathrooms. Of course many will try to restrict them to customers.
https://www.cga.ct.gov/2006/rpt/2006-R-0739.htm
But at least in Florida it seems they can be restricted to paying customers:
http://www.nbc-2.com/story/25446355/good-question-restaurant...
Last time I was in EU was 10 years ago but tried to use a toilet in a bar and got yelled at unless I bought something first.
Even in the US you cannot just walk into every bars and restaurants and use their toilets for free...
Take another extreme - allowing people in only if they will definitely buy something in the store. It reduces shoplifting and traffic that doesn't buy anything! Except that would drastically reduce sales from lack of people who haven't already decided in addition to being put off by it. The "buy something" policies strike me as similarly pennywise and pound foolish.
If you're in a place with tons of mentally disabled folk or other type of people that don't respect public areas, then it's going to cost you more than it helps you.
Also, it could be more headache than its worth if you're at a big tourist spot where the probability of someone buying something is not high enough compared to the enormous amount of people who will want to use a bathroom.
That said, by and large sny national chain will allow use of their facilities.
What? McDonald's are pretty much everywhere in Oregon