Sherlock always identified as a cisgendered male when he was asked. This was technically true, and he felt no real discomfort with this lie. He had a penis, he had a prostate. The sex hormone that his brain produced then sent through his veins was testosterone, not estrogen. The likelihood of him growing breasts was very very slim. Still he felt a twinge of wrongness each time he was forced to place himself into a box. English was a ridiculously constraining language, forcing him to chose one of two nouns, as referring to himself as "other" a) made him feel like an tick box, a sensation that was not particularly pleasant, b) made people think he was joking and give very forced, awkward laughs. The one time he defined himself as "other" and the person he was speaking to actually understood what he meant (Mycroft), he was immediately told that could never say that to anyone, for they would not understand, and people with lesser minds react violently to things they do not understand.
The sense of wrong existed long before his post-university plunge into the more sordid side of London gave him a rather intimate knowledge of gender/sexuality. Afterwards he came to the opinion that if gender were a sliding scale he was in the middle, except not both, but neither. Though Sherlock's body was most definitely male, his mind was not. If sexuality were a sliding scale Sherlock would be in the middle as well. His views on sex was that it was a tool as any other, and though he did sometimes feel attraction to others, he soon learned to control this. Sherlock's body was very attractively male, and he often used this as an advantage.
When Sherlock first met John Watson he immediately noticed that John Watson was male but not of origin. Further digging and a favor owed from Mycroft showed that John Watson was originally Kaitlyn Watson. Sherlock decided to keep this silent because he was certain that John Watson would never talk to him again. As John Watson was one of the first people Sherlock had been Unable To Control His Attraction To in a long time, Sherlock did not want this, even if John was straight. He was surprised when John dated Sarah, because Sherlock knew that some people were uncomfortable with sexes and genders not matching up.
One day John asked Sherlock if Sherlock was a girl. Apparently he had heard two of the Yarders discussing this theory, and wanted to know what Sherlock thought on that. Normally Sherlock would have told John that it was stupid for John to listen to the Yarder's natterings, but Sherlock guessed that this was an Emotional Topic for John Watson and that maybe he should Be Careful and Act Within Social Bounds, which unfortunately had been forcibly placed into the To Be Not Deleted But Ignored section of his Mind Palace.
Sherlock decided that maybe John would understand if Sherlock told him. Sherlock told John that he felt that he was neither gender and that the English language was Annoying Limiting and that there should be more than two words for gender. He also told him about the Years That Should Not Have Happened. Then more nervously Sherlock told John that he knew that John's original sex and gender did not match up.
John said that he was Not Surprised that Sherlock knew who Kaitlyn Watson was and that he was glad that Sherlock did not think it strange. John also agreed with Sherlock that the English language was ridiculous in it's limitation, but that unfortunately it is the only language he can speak. He also asked what of the two pronouns Sherlock preferred, and Sherlock said that "he" would be fine until a new one was made up. "I"t was for objects, and Sherlock was not an object, he was a person.
John said that he knew that Sherlock was a person and not an object, and that he was glad that Sherlock was not insisting on calling him Katilyn. He also told Sherlock that he would kill him if he ever told anyone the name that his parents gave him but wasn't his name. Sherlock decided that asking the details of the changes John gave his body would be against Even John's Limits and refrained from asking and instead decided to google it later. Maybe it would be Important For Later Cases.
Sherlock then told John that he was incapable of controlling his sexual attraction/maybe love for John and if John Wanted To Go Away he would be Ok with that. John told Sherlock that he is not from the 1800s and that just because Sherlock did not have a mental gender did not mean that John thought that he did not have a sexuality. John then told him that John also was attracted/maybe in love with Sherlock but had been worried because he did not know if Sherlock would be OK with him not being normal.
Sherlock then said that normal was boring and that remember he could see everything. John reminded Sherlock that Sherlock had been wrong about Harry. Sherlock said that if John still had a vagina he would be Ok with that, Sherlock had had stranger sex while high. John said that he did not want to know the details, and Sherlock said that that was good because the thoughts were deeply buried inside Sherlock's mind palace. Sherlock asked John did he want to have sex. John said that usually people went on dates first and Sherlock said that by John's definition of date they had been going on dates for a long time now. John then decided to kiss Sherlock and Sherlock thought that this was definitely better than the Weird Sex that he had had during the Years That Should Not Have Happened. He also though that John was a very good kisser and that he was very happy. Maybe the Maybe Love was Actual Love. Then Sherlock's mind was incapable of actual though for a Long Period Of Time.
