Early on I didn't really know how to talk to girls, so "accidental" flashes or opportunities for casual nudity where a substitute for flirting.
Later, such as when I was in corporate jobs, it was a way to establish some power. Working out, playing golf, etc, gave opportunities to end up in a locker room next to guys I felt like I wanted to make a point to.
And -probably one of the big ones for guys that read these threads - I won't shy away from an chance to stand at a urinal next to a guy who is dating an ex or who used to see my date that night. One of my favorite bars in town still has a trough style urinal and if you walk in and the guy is standing there, he is kind of a captive audience. I may or may not decide to double down with eye contact, but you can always tell how they react, even out of your peripheral vision.