That manner of speaking is affected, not genetic. It’s a calling signal to one another.
My wife and I were having breakfast in Provincetown, MA some years back (a Portuguese fishing town that became a homosexual enclave) and we were playing the “Who Is and Who Isn’t game.
There were two men at a table close enough to hear them converse, and there was nothing in their speech or manner to indicate if they were or weren’t homosexual. They sounded perfectly normal.
Then the door opened and two guys they knew came in, and their speech suddenly turned into full-blown lilted homosexual speech!
My wife and I nearly fell on the floor! So I think you are spot on...that mannerism is a calling signal, as you put it!