Having never read any formal dress code rules for any office, hospital, or place of worship I've been inside in my life, I've never gotten kicked out for wearing the wrong thing, and I've also never seen someone wearing a swimsuit in any of those places. This isn't some uniquely problem that only chess tournaments have, and it's not nearly as hard to solve as you're making it out to be.