For me, it isn't so much the explanation, as the execution and characterization.
But for him turning female, I would also require some kind of an explanation. I'm open to handwaving, though.
What sort of an explanation? Timelord regenerations are established as being able to change gender. What more explanation would you need?
Why hasn't it happened until now?
It has. The Corsair mentioned in The Doctor's Wife changed gender.
Yes. You misunderstand: Why hasn't the Doctor switched genders until now?
Because the BBC suspected that the viewers didn't want him to. I wouldn't try to find any deeper reason than that!
He can; he just hasn't.
Yes. You misunderstand: Why hasn't the Doctor switched genders until now?