It would appear the idea of having the Doctor regenerating into a woman was being considered as far back as the mid-1980s.
CultBox reports Doctor Who creator Sydney Newman talked about the possibility of our beloved Time Lord eventually pulling a gender switch in a letter to BBC One controller Michael Grade back in October of 1986. Newman — who co-created the series with Verity Lambert in 1963 — said: "At a later stage, Dr Who would be metamorphosed into a woman." He also added in the letter: "This requires some considerable thought – mainly because I want to avoid a flashy Hollywood 'Wonder Woman' because this kind of hero(ine) has no flaws – and a character with no flaws is a bore."
It's rather interesting to note this discussion was taking place during the second season of the Colin Baker era (he played the Sixth Doctor), which Newman called "largely socially valueless, escapist schlock."
The idea of the Doctor becoming a woman has been bandied about in the past couple of years, but is something current showrunner Steven Moffat may not be considering as we speak (though he's not ruling it out completely), since they just made The Master into Missy (Michelle Gomez) and all that. Also not a fan of the idea? Fifth Doctor Peter Davison.
Moffat said last year: "It will not happen that somebody sits down and says we must turn the Doctor into a woman … A person will pop into the showrunner’s head and they’ll think. 'Oh my God, what if it was that person?' And when that person is a woman, that’s the day it will happen."
Are you surprised that Sydney Newman considered the Doctor becoming a woman almost 30 years ago?