I know that you're joking about fiction, but I can't help but apply your middle sentence to people who deliberately develop lisps.
The thing is, people don't generally consciously, deliberately develop 'lisps' (by which you mean the sibilant S that characterizes gay voice). The only group to routinely do so are trans people.
A lot of gay men who have gay voice don't like the way they speak, or feel that it hurts them professionally and socially (which it often does). The gay community has such a thing about hypermasculinity now that it's not even an asset there.
Gay voice often manifests in adolescence, but you can find plenty of people who have or had it as children. There are a bunch of theories as to where it comes from, but it's largely unconscious, it just happens. The reasons are probably very complex and individual. It's possible that, for some people, it probably is a strategy they developed for immediately testing whether the people around them are going to be homophobic or not, but if so, it wasn't conscious.
Gay voice is used in fiction, a lot. The problem is that when you use gay voice in fiction, you often end up referencing and repeating the various pejorative or infantilizing stereotypes of queer men that straight people still seem to love for some reason. Today, it's often used to position queer (or queer coded) men as cutesy and non-threatening, rather than evil, but honestly that feels like a huge downgrade to me.