It can be done in the debug menu under "open character creator" or something like that.
Talking about npc
No medicine that can change other characters gender.