Using River's regens might be a fun excuse to have him regenerate into a woman after Capaldi.
They don't need an excuse. In "Destiny of the Daleks", Romana is shown "trying on" several faces after her regeneration, at least one of which is male. So we know Time Lords can switch sex when they regenerate.
Honestly, I don't see this 'need' for a female Doctor, any more than I see a need for a female Bond, or a male actor playing the Queen. But, if they decide to go that way, and if they find the right actress, there's no particular in-universe reason why not.
That's how I'd handle it. He gained a few extra regenerations from her.
But there's the possibility John Hurt is a previously unknown regeneration between the 8th and 9th Doctors, so Capaldi would be the 13th and final version.
I'd be inclined to handle it by giving the Doctor some easy means to extent (or eliminate) the limit... and at the same time give him good reason
not to use it. Perhaps by forcing him to face whatever this dark secret of the John Hurt "Doctor" is, or perhaps his actions as the Valeyard. Either way, have him conclude that he doesn't want to regenerate again, and so put the device somewhere away beyond use.
(Potentially, he could then take the "Dwarf Slayer" route of seeking out more and more dangerous situations - he won't kill himself, but he does want to end his life, and will seek to do as much good as possible while doing so.)
Which would, I think, give a new role to the companions, something I don't think we've seen before - their job now is to keep the Doctor alive long enough to change his mind, and also to, well, change his mind.