Doctor Who’s lead writer and executive producer has added his voice to a growing chorus defending the BBC at the Edinburgh international television festival. Speaking after a screening of The Magician’s Apprentice, the opening episode of the ninth series, Steven Moffat insisted that only the BBC could have commissioned something as idiosyncratic as the long-running show, which celebrated its 50th anniversary two years ago.

“It’s fair to say that there’s only one broadcaster in the whole world that would have come up with and transmitted as good an idea as Doctor Who,” he said, offering a mock version of what a contemporary pitch for the Who might sound like. “‘What’s the spaceship going to look like?’ ‘You’re going to love this’ ‘Is he going to be a young dashing hero?’ ‘Sometimes.’”

Facebook Twitter Pinterest Steven Moffat, Doctor Who’s lead writer and executive producer. Photograph: Invision/AP

Along with the Great British Bake Off and “everything David Attenborough has ever done”, Who is a wonderful example of the corporation’s breadth, according to Moffatt. “There is no other broadcaster so madly varied and so genuinely mad,” he said. “Can you imagine what the world would be like without that insane variety? ‘What will be big next?’ ‘Baking.’ You can’t even taste the cakes!”

He joined Bake Off star Sue Perkins and Veep and The Thick of It writer Armando Iannucci, who delivered this year’s MacTaggart lecture, in a staunch defence of the BBC. “I think a very small number of people think the BBC is a very bad idea and a huge number of people think the BBC is a wonderful idea and sadly the small number of people are all in government – that’s giving a slightly unbalanced version of events … I wouldn’t normally go around saying ‘read the MacTaggart’ because I like you, but this one is epic; it’s incredibly funny and it is so on point. You’ll be both laughing and air-punching, which is what I like to do when reading a speech.”

Moffat was asked if he had found working with the current Doctor, Peter Capaldi, a challenge, given Capaldi’s deep knowledge and love of the show (he once wrote a letter to the Radio Times about the Daleks when he was a teenager). Who is the bigger Who fan?

“His love, we can compete on that, just let it be understood. But in a face-off, in a head-to-head, he’s nowhere bloody close,” Moffat laughed. “I’m ahead on knowledge. I am. Honestly.”

Facebook Twitter Pinterest Great British Bake Off contestant Rob Smart with his Dalek cake. Photograph: BBC

The producer admitted that illegal downloads of the show meant that he did not actually know how many viewers the show has around the world. “There’s evidence that people might occasionally be watching by other means … but we don’t know how many people have seen the show; nobody knows those statistics and we hate them all, we don’t – but we do.” However, executive producer Brian Minchin offered statistics about T-shirt sales in America (“4 million”) as evidence of the show’s global impact.

Moffat said he would be inclined to resist any move to release a future series of Doctor Who in a Netflix style, with all the episodes available at the same time in an all-in-one binge-watch dump. “I kind of think Doctor Who probably belongs once a week – it’s big and it’s loud and it’s mad,” he said.

“The fact that we’ve had the 50th anniversary recently obscures the fact that the new show is quite old – it’s 10 years old … It’s epically successful. Shows don’t do that after 10 years; they gently decline. Doctor Who has gently declined to gently decline.”

Doctor Who returns to BBC1 on Saturday 19 September

