In one far-future episode, “The Satan Pit,” the Doctor is facing down a beast claiming to be the devil and asks which religion it belongs to, mixing real and imagined possibilities ...