Don’t say gender; say, sex.
Or use the words as synonyms when referring to people. The pretense that mental illness can change a person's gender is a recent ideological manipulation of the English language.