Sometimes a guy has to express himself and he may not have a facility with writing poetry or painting a still life of three mangos and a pear. But he can expose to express.
And maybe if he's multi talented, paint a still life of his moving penis and ass and then write a poem about it.
I definitely need to practice some immediate responses if I run into one of these situations. Like for the stealthy penis selfie guy at the gym, I could say: "If you want to do a bicep double flex at the same time, I can take your picture for you."
Though his thrill and/or embarrassment at being caught may risk triggering an ejaculation causing him to lose the mood. Though that would make a good photo too, titled (for display at the finest art gallery) "Gym Bunny in Repose" or maybe "Gym Cock Blast" though I'm partial to anything with bunnies.
The guy at the restaurant with his dick hanging out would probably result in me loudly saying "Your dick is hanging out." Keep it neutral and see what happens.
Just like flirting opportunities, instances of public or semi-public nudity can happen (and be gone) in an instant. So be ready to react with words, your own body language, or some combination.
Or if you see a naked hitchhiker, I think the appropriate reaction is to film it from a safe distance and post it to YouTube with a Mariah Carey song in the background. It's going to be taken down in minutes anyhow, so may as well have cock and whistle tones in the same video. That's what life is all about.