Is it true that Victorians would understand earnest in a slang sense to mean gay? For example, in Wilde’s The Importance of Being Earnest is there an assumed pun on “earnest”? This was suggested in Wikipedia:
The use of the name Earnest may have been a homosexual in-joke. In 1892, three years before Wilde wrote the play, John Gambril Nicholson had published the book of pederastic poetry Love in Earnest. The sonnet Of Boys’ Names included the verse: “Though Frank may ring like silver bell / And Cecil softer music claim / They cannot work the miracle / –’Tis Ernest sets my heart a-flame.” The word “earnest” may also have been a code-word for homosexual, as in: “Is he earnest?”, in the same way that “Is he so?” and “Is he musical?” were employed.
 Nicholson (1892:61) (Love in Earnest: Sonnets, Ballades, and Lyrics)
 Ellmann (1988:88) (a long the riverrun: Selected Essays)
Is it true that Victorians would understand earnest in a slang sense to mean gay?
Is it true that Victorians who were active in the underground queer scene of the time would have understood it that way?
Less doubtful, but still pretty doubtful.
It’s been suggested that Earnest and indeed Cecil (the name of another character in the play is the related Cecily) were used as slang within the queer scene of the time. Earnest in particular allows for a crude pun; we talk about being “in earnest” which allows one to ask “Earnest who?” punning that “in earnest” means sexually penetrating a man called Earnest. By extension Earnest could become a slang term for a gay or otherwise queer man, particularly one who enjoyed bottoming for penetrative sex.
This is conjectural though. I haven’t read the article cited as suggesting this (Laurence Senelick, “Master Wood’s Profession: Wilde and the Subculture of Homosexual Blackmail in the Victorian Theatre”, in Wilde Writings: Contextual Conditions) but some who have cited it seem sceptical of it. Neither Earnest, Cecil, nor Cecily appear in any of the lexicons of Polari (the gay and theatre cant in London from the Victorian times through to the middle of the 20th century) I’ve seen as far as I recall, nor in any I can find online with an (admittedly not very thorough) search.
But then, there were certainly subtleties to how queer slang could work. “Is he so?” as you quote above certainly was used to mean “is he queer?” but is also says very little to those not in the know. While Polari and its relatives stand out as being blatantly unusual speech, though the meaning may not be penetrable to the aunt nells of most naff omis (ears of most straight men), subtler communications were important too.
To say that Earnest “may” have been understood that way, which is all the quote claims, seems reasonable enough. To go beyond “may” seems a stretch.
A big caveat to this is that a lot of readings trying to find signposts of homosexual activity in Wilde’s works began with his libel suit (which in turn led to his criminal trial) and continued ever since. Some such suggestions are almost certainly wrong (e.g. suggestions of the word bun elsewhere referring to buttocks are anachronistic and of their referring to queer brothels seem fully unsupported). The existence of more doubtful signals found in his work leads one to suspicion of all attempts to find them. While Wilde is certainly open to queer readings, I think most need to go at least a little further below the surface than just noting which names were used.
So, I’d go with the “may”, but a very doubtful “may”.