Here comes the most dignified, intelligent and thoughtful American president of modern times. He arrives as a reminder that amid Tea Party craziness and Trumpery, hysterical slanders, racist smears and savage politics, a man can not just survive and thrive, but walk tall without descending in to the gutter with his opponents.

Those who watched Norma Percy and Paul Mitchell’s magnificent BBC four-parter, Inside Obama’s White House, will have come away with an enhanced sense of how a good – maybe a great – man, can keep his head when all about are losing theirs. This he does in a political system that now thwarts whatever plans a president is elected to implement. In the middle of the razzle-dazzle of the US election campaign, we should remember how empty the power bestowed on inauguration day can be.

Obama arrives in Britain today for what will be his last visit here as president. With what grace he humours our absurdities, not only taking a birthday lunch with the Queen, but also a dinner at home with the Cambridges: William’s inarticulately vacuous BBC interview makes you wonder what on earth they will talk about.

Nigel Farage calls Obama the most anti-British president there has ever been. George Washington, anyone?

Our idiosyncrasies he tolerates, before the real business: talks with the prime minister and a town hall meeting with young people where he will proclaim for remaining in the EU. That’s what he’s really here for. Then on to Germany.

If on 23 June we vote to leave, future US presidents may bypass shrunken little tin-pot England with its showy royalty, ignoring a Ruritania whose empty ceremonial strutting will look yet more comical when stripped of its present influence. Scotland gone, struggling with the economic fallout from our own folly – why stop here? Instead presidents will head straight for the German chancellery. We shall no longer boast of being the “bridge” between the EU and Washington. The outers’ pretence that striking a unilateral deal with America will be better than being that bridge looks thin indeed, when the president makes such an exceptional effort to keep us inside.

The bad blood now haemorrhaging from the two sides within the Tory party will look familiar to this American. Boris Johnson, with his Trump-like hair, calls his own leader a Gerald Ratner selling “crap” politics. This London mayor imagines he might be prime minister by the summer, yet undiplomatically calls out the US president for “hypocrisy”. Nigel Farage brands him the most anti-British president there has ever been. George Washington, anyone?

What’s more, Obama will recognise all too well the racist assaults on Sadiq Khan, Labour’s candidate for London mayor – not dog whistle but foghorn. In tone they match the attacks on Obama’s Muslim heritage that he still endures from the demented “birthers”. A third of Republicans believe he was born abroad, and secretly practices Islam, along with charges that he is the antichrist and part of a Muslim plot to take over America.

The smears against Khan smack of the same strain: anyone of any Muslim heritage is secretly complicit with extremism, by association working towards some global caliphate. Under the skin, they’re all the same, whatever they say or do – that’s racism. The Khan who Labour people know is a doughty opponent of extremism, a rational and decent MP.

Barack Obama to make long-awaited appeal for Britain to stay in EU Read more

As for appearing on platforms with an “extremist”, it turns out Zac Goldsmith and another Tory minister did too – and the man is a Tory supporter.

The shock this week was to see David Cameron join this smear, which Jeremy Corbyn rightly called “despicable”. What Cameron’s attack implies is that no Muslim can ever run for high office, because somewhere along the line he may have rubbed shoulders with some homophobic misogynist of nominally the same religion.

Here was Cameron at his most undignified, bullying, thuggish. What a contrast with his American guest. No doubt Obama would be too polite to admonish Cameron for this bout of Muslim-bashing, but his presence might remind our prime minister of the importance of political dignity. Were Obama less tactful he might also offer some good advice on winning the EU referendum.

Cameron needs to be the nation’s leader, speaking for Britain in an hour of peril – albeit a danger he has inflicted on us. Until 23 June he would do well to avoid sectarian party-political playground behaviour and acquire a loftier demeanour, an air of authority on the nation’s future. If he hopes some of the Obama aura rubs off on him on this visit, he needs to learn a lesson or two on what a good leader says and does.