[SPOILERS ahead for the Doctor Who season 10 finale.]
In the previous episode, it was revealed that a mortally wounded Bill had been converted into a Cyberman by the Doctor's old nemesis, the Master. After the Doctor fell to an army of the cybernetic monsters, it seemed as if Bill would be doomed along with him. But at the last moment, Bill and the Doctor were rescued by Heather, a character who appeared in the season 10 premiere 'The Pilot', where she was possessed by a watery alien creature and departed Earth. Bill is transformed into the same sort of entity as Heather, and the duo depart the TARDIS to begin their new adventures together.
On Doctor Who: The After Show, Moffat commented on the decision to spare Bill from such a brutal ending, and on how he sees the show as a beacon of hope in an increasingly dark era of television:
"I’ll just say this and I’ll get into terrible trouble with certain people...I don’t think Doctor Who is that kind of show. Doctor Who is a big hearted, optimistic show that believes in kindness and love and that wisdom will triumph in the end. I don’t believe it’s the kind of show that says there are bitter, twisted, nasty endings because it’s not. It’s not gritty; it’s aspirational. It says, ‘It can work. And wisdom and kindness will triumph. And love will always come through in the end.’ I think there aren’t enough people or enough shows saying that and I’m damned if Doctor Who is going to join in with the general chorus of despair."
When asked about Bill's possible future on the show, Moffat says he's left the door open but is unsure of what awaits her.
"So, she doesn’t die. She nearly dies. She nearly dies and she becomes something else. And we leave it in such a way that, again, I don’t know future plans, I’ve kept away from them, I put it such that, because Heather does say 'Look, I can put you back on Earth if you want to go back and make chips,' she could. So any of those are [possible]. I kind of think in my head she flies around the universe with Heather. That’s what she does."
Moffat, who took the reins of Doctor Who from Russell T. Davis in 2010, seems to be preparing to firmly close the book on his iteration of the show once he and Peter Capaldi depart after the upcoming Christmas Special, which will feature the return of the First Doctor, as portrayed by David Bradley.
Incoming showrunner Chris Chibnall has made no firm statements about his plans for the show's return in 2018, but it appears as if he'll be starting from scratch with both a new Doctor and a new companion.
Source: Doctor Who: The After Show