When Margaret Thatcher won the British general election in 1979, she had become Europe’s first woman prime minister, although the world had seen its very first female head of state, Sirimavo Bandaranaike of Sri Lanka, nineteen years earlier.
(A) When Margaret Thatcher won
When she won the election, she "had become" ? she was already the first woman PM before she won? - Wrong tense.
(B) Upon Margaret Thatcher’s winning
this looks good "upon Thatcher's winning the election 1979, she
had become first PM, although the world
had seen"
yes, there is a confusing pronoun referring to a possessive noun but there is no other feminine noun before the first "she" to create ambiguity. It can't be the sole reason to eliminate B IMHO.
refer the famous Elizabeth Barrett Browning's success question
hereI am not completely convinced with the use of "had" without comparable past event but still chose this.
IMO B(C) Whenever Margaret Thatcher won
whenever causes a meaning issue as if she won election multiple times in 1979 and whenever she won she became the first woman PM.
(D) Margaret Thatcher had won
This will create a comma splice error : Thatcher won election, she had become (two independent clauses without conjunction)
(E) At the time Margaret Thatcher won
This phrase also tries to arrange the events chronologically; I believe it doesn't go well with the two "had (verbs)" for reasons stated above in A.