For this, let private companies install public pay toilets. Let activists fund free pay toilet passes for the homeless/poor.
Eventually there should be a couple brands of private public toilets where some are essentially free (lets say you own a business in an area with no public washrooms, it may be a financial benefit to you to sponsor a public toilet) and others are more luxury with higher prices to keep the riff raff out and fund more public ones.
There is a market solution if the government gets out of the way.