These are all funny responses. And I'm laughing with you. But what would you really say in this instance? A stranger who's having an issue like this?
It's kind of along the same lines as a male who notices a "stain" on a female (that he doesn't know) skirt or pants?
Opposite gender and something really personal - what's the best way to approach it?
I don't think it's equivalent: a stain on my pants might be embarrassing, but it's not sexual (for me or the hypothetical viewer). This isn't about hoping that what you're seeing on someone's skirt is brown paint or some kind of sauce, rather than anything more personal: it's the actual part of this guy's body.
Given the choice, I would much rather be warned discreetly by a stranger (of any gender) that I had accidentally exposed a nipple (or my private parts), so I could re-cover it, than be spoken to by a police officer, told to leave the pool area by a lifeguard, or yelled at by someone who was upset that her children might see.
I think I would say something quietly, maybe "your fly is open" rather than something cute (even if I thought of a cute phrasing quickly) and then turn/walk away, to minimize his embarrassment.