Many transit centers are owned and operated by a municipal transit agency and typically have restrooms, especially large airports and train stations.
Public rest areas are pretty common along major highways and these include restrooms.
Publicly-owned parks usually provide a place to poop, too: Sometimes it's an installation with composting toilets, sometimes it's just a seat over a septic pit that needs pumped out periodically. Sometimes, it's fancy with flushing toilets and sinks for handwashing. Other times, it's just a rented portajohn (that may be full of spiders and smell like death, or be very tidy). And sometimes, they're locked at night when the park is closed. But -- usually -- public parks of any substance offer something for facilities.
Just last week, I worked next to a public park in a very small town (population ~2,000) with some well-maintained basketball and tennis courts. There were a couple of portajohns present. (I did not investigate them further.)
And when there's a major events that draw crowds, like our very public fireworks displays in downtown areas: Temporary restroom facilities are provided.
What we don't have very much of here are permanent, literal-public restrooms in the denser parts of cities. That is very problematic, but it is slowly improving[1].
[1]: https://downtownservices.org/news-article/three-public-restr...
You've never been to the beach, a city park (or state or national park), a highway rest stop, or any of the thousands of other places public restrooms exist?
What a weird take...
I was also not considering things like port-a-potties during public events, since i was only considering permanent structures.