If using the sonic screwdriver is a satisfactory way to explain how 99% of the Doctor's problems are solved, I'm sure they can explain how he can become a woman satisfactorily.
They've already given us a preemptive explanation, surely?
When that Time Lord General character in "Hell Bent" regenerated from a white man to a black woman, her initial post-regeneration dialogue confirmed that it was the only male incarnation she'd ever had in an otherwise consistently female lifespan.
The idea that a Time Lord/Time Lady
can
randomly change gender and/or ethnicity as a "one-off" freaky thingy, but in practice it presumably happens rarely and/or to precious few Gallifreyans, is frankly the
only
in-story conceit that would satisfactorily explain The Doctor who has thus far remained consistently white & male over numerous incarnations ever suddenly becoming anything other than that.
Now that precisely such a conceit has been established as part of the show's lore, any non-white and/or non-male casting (as long it's the best actor for the job, not mere tokenism) is absolutely fine by me.