Is that polite though? I get that it isn't explicitly rude but I pretty much only use that phrase as short hand for "why are you talking about this you fucking weirdo?" I think it's subtly rude at best.
Most politeness is about rephrasing rudeness in a subtle way. What OP's fictional coworker did in this fictional story is explicitly rude as it assumes the worst from meeting a new person, the most appropriate response would be something that is subtly, but noticeably, rude.
If a team lead, sight unseen, just tells you their sexual preference without any context or follow-up then yeah that's fucking weird and they're a weirdo.