Public photography isn't a crime, but then again it's very nuanced. If I'm taking a portrait of a park, where people are having picnics, it seems "less targeted", if you know what I mean. Whereas walking with a phone or camera in your hand pointing directly at people's faces feels not really right.
The best way to do this would be how Google solved this with street view. Capture your public photos, blur out people's faces - better yet, respect their privacy if someone requests to not film them. Eg. Google Street view will blur out complete homes if you decide to opt out.
It’s practically impossible to take pictures of a famous monument without having other people in the frame (usually they’re posing for photos themselves). AI can remove them, with varying degrees of success.