San Francisco built a bunch of 24-hour public restrooms in the early 2000s downtown, and today they're horrendous. The problem is cyclical: people shit on the streets because there's no public restrooms -- but there's no public restrooms because San Francisco is filled with psychopaths who have no problem dropping their pants and shitting in the middle of a street. Give them a public restroom and they'll destroy it.
The people causing these problems aren't normal people who think like you and just happen to be homeless. You can't relate to them by trying to project yourself into their position. They're completely different mentally. They do not think rationally, and they do not have any empathy for others around them.
Your comment is downvoted but it's something that has to be considered. Yes people shit on the streets because there are no toilets, but there are no toilets because it's extremely difficult to provide them due to abuse. It all links back to drug abuse again.
This would require some significant trial, design, study. My first question is are people who are willing to use a toilet publicly exposed actually likely to use it vs just some quiet street. And there are still plenty of ways to ruin a utilitarian toilet like shoving trash in and blocking the drain. At the very least most people can admit that the problem is more complex than simply dropping in some public toilet blocks.
You have to consider these things because there are more than enough people willing to destroy things simply for the purpose of destroying them.
Meanwhile Paris has about 400 of them, 150 of which are 24 hours, costing €6 million per year.
[1] https://en.wikipedia.org/wiki/Sanisette
[2] https://en.parisinfo.com/practical-paris/useful-info/public-...