Oh you get ungayed. But you risk dying as a gay redshirt on the planet below. Or you'll save the day in the gayest way possible. Also if your ship or shuttle is destroyed in orbit you'll be stuck gay.
In my overview for my suggested Star Trek series that from its third season onward was about a massive war between the Federation and its allies with the Borg, I considered the idea of having one of the top Starfleet officers turn out to be a brutal serial killer (preying on members of his own crew) and having the commanding Admiral of the allies forces discovering this. But the officer is so outstanding in combat and vital to the war effort that the Admiral decides not to get rid of him. For now....