Donald Trump in his office in Trump Tower in New York. (Jennifer S. Altman for The Washington Post)

By all conventional understandings, Donald Trump has not exactly had a terrific week. Univision cut ties with his Miss Universe Organization, which stages several pageants, after a speech in which Trump described Mexican immigrants as rapists trafficking drugs into the United States. Hundreds of thousands of peititioners have urged NBC not to air the Miss USA and Miss Universe pageants and to cancel all iterations of “The Apprentice,” Trump’s long-running reality competition show on the network. But while for other candidates, these developments might in fact be a disastrous hit to their business interests and their political prospects, provoking Hollywood into kicking him out is great for Trump both as entertainment and as politics.

For all that Trump is bragging about the show’s artistic accomplishments and ratings, the “Apprentice” franchise is far from the mega-hit it was in early seasons. Going out on what, by the standards of contemporary television ratings, is a respectable if not overwhelming performance might be a smart move. If Trump hung on until ratings for “The Celebrity Apprentice” cratered, or until NBC figured out a programming lineup that worked better, he would have to suffer through the program’s cancellation. He might even be pulled into the slightly embarrassing cycle in which the people involved in recently canceled television shows start campaigns to reverse the decisions or to find a new outlet for their programs.

Either way, Trump would become just another television star at the end of his run, rather than maintaining his pretense to be genius businessman who’s capable of defying market realities. Leaving to run for president instead would let Trump avoid that narrative, allowing himself to position himself as exceptional in another way. Instead of being someone dependent on television for his livelihood and platform, Trump would present his time on television as something he deigned to do before moving on to more important and challenging enterprises.

As politics, getting tossed from “The Celebrity Apprentice” would also let Trump move away from the charge that he’s merely an entertainer and that running for president is a way to boost his primary career. Trump is more vulnerable to this image than other candidates with significant media careers, including Mike Huckabee and Ben Carson, who can at least argue that their books and television and radio work are primarily political. “The Apprentice” franchise may have championed entrepreneurship, but it hasn’t exactly been a vehicle to argue about policy issues such as health-care coverage requirements for small businesses.

But if Trump can suggest that NBC, like Univision, is getting rid of him because of the positions he’s taking, there are all sorts of new political options available to him. He can argue that his comments about Latino immigrants are a form of brave truth-telling about both Mexican culture and American trade policy that are too hot for networks — especially one like Univision, which aims at a primarily Latino audience — to handle. Trump can also position himself as a conservative victim of Hollywood discrimination, someone who has been inside the machine and emerged with truths about the entertainment industry’s liberal bias that the world needs to hear.

Having had that experience doesn’t necessarily give an entertainment industry veteran a successful instinct for politics: Letting Clint Eastwood do whatever he wanted at the 2012 Republican convention arguably embarrassed both the great director and the party that invited him. But positioning themselves as dissenters to the liberal Hollywood consensus can be a way for entertainers to establish a base that keeps them relevant even when their careers aren’t exactly blowing up. Adam Baldwin is a great example of this phenomenon.

I suppose there is something a little jarring about the idea that someone with Trump’s decades-long record of bombast would settle for a simple role as a showman and that someone would use a run for the presidency this crudely and this obviously. But whether he’s developing a real estate project or talking up his television shows, Trump has always known how to leverage hype — and when to compromise, whether that means giving up ownership in a project or shifting television formats. Trump has been threatening to run for president for decades. Given how well both television networks and public opinion are cooperating with his script, the only surprise is that he didn’t pull the trigger earlier.