They must have been high-fiving (or whatever Foreign Office mandarins do to celebrate) when the news came through that Theresa May would be the first foreign leader to meet President Donald Trump – before Israel’s Benjamin Netanyahu, before Enrique Pena Nieto of Mexico, and before the Queen of Europe, Angela Merkel. The glad tidings promised an end to what had, after all, been a very tricky start.

Almost anything that could go wrong had gone wrong. Our man in Washington was accused of miscalling the election, leaving the UK without contacts in the Trump team. There was the highly undiplomatic suggestion, made by the then President-elect himself, that Nigel Farage would make the ideal UK ambassador for the new era. Then as a postscript came inferences – little more – that British intelligence had some sort of involvement, even at one remove, in a dossier designed to discredit the new President. The “special relationship” was starting to look at best somewhat frayed.

But now, in what would appear by any standards to be a triumph of statecraft, everything has come out all right. In fact, it is a good deal better than all right.

There is a nice soft prelude in Philadelphia, where there is a shared history (the Liberty Bell and all that) and where she will be among friends, joining an away day for Republicans (nostalgic Thatcherites all). Trump will be there too, so she will have a chance to get the measure of the new President before starting the serous business in Washington the next day. Not only that, but just in case it all goes badly wrong – Donald Trump’s endorsement of waterboarding hardly made for an auspicious start – she will be flying out the same evening for a brief visit to Turkey. The words and pictures can be adjusted accordingly. So well done, everyone; jolly well done.

Republicans 'openly considering Donald Trump's emotional stability'

For the White House, the early invitation to Theresa May was an astute move. Maybe the Downing Street fixers even made that argument. Trump may be heedless of his image (though not quite as heedless as his reckless bombast might suggest), but the set of pictures he badly needs is one that shows he knows how to behave around women. That is what last Saturday’s massive marches on both sides of the Atlantic were mostly about. And while it is easy to object that he is no Reagan and she is no Thatcher, referencing the Ronnie-Maggie show still plays well way beyond Peoria.

So in terms of symbolism and appearance – what we now apparently have to call the “optics” – a good job has been done that promises benefit to both sides. The wisdom of the whole exercise from the UK side, however, is quite another matter.

How was Theresa May propelled to the front of the queue for that first Oval Office handshake? What undertakings were given – after, of course, the gilded carriage-ride up the Mall and the banquet at Windsor Castle? Is it not demeaning that to be first into the Trump White House appears still to signify so much in the corridors of power in London? And the positioning of that Churchill bust?

Is the public flattery that the Prime Minister has included in her Philadelphia speech in the nation’s name really necessary? Does it make sense for the UK, having gone to such lengths to break with what the Leave campaign cast as the EU’s constraints on its sovereignty, to appear to beg for an even more special relationship with the superpower across the Atlantic? And what of the bilateral trade agreement that the UK appears to have in its sights?

Remember the precise fears about the terms of the deal that threw up so many stumbling blocks with the EU: data protection, hormones in meat, an open door for US pharmaceuticals, possible inroads into Europe’s socialised medicine. Are we to accept terms that, as an EU member, we would have rejected, just to demonstrate that we are not all on our own out there?

With US participation in the Pacific trade pact signed away by Executive Order on Trump’s first day, and renegotiation of the 18-year-old North America Free Trade Agreement now in the President’s sights, forecasting any advantage for the UK from a separate deal would seem foolhardy.

Donald Trump's Wall: Mexican President's response

Defence and security are the other links that the UK is concerned to maintain. From the North Atlantic Treaty Organisation via the Trident missile system to the “five eyes” arrangement for intelligence sharing, the UK makes no secret of its preference for formalised links with the United States rather than with its nearer and more natural partners in Europe. Only days after the UK’s vote to leave the EU, the defence secretary, Sir Michael Fallon, was on his feet threatening to “veto” any plans the rest of the EU might have for a European army, a demarche rightly resented across the Channel.

Advance reports suggest that Theresa May wants to disabuse the US President of his idea that Nato in its present form is “obsolete”. She also, apparently, plans to warn him against a rapprochement with that all-purpose bogeyman Vladimir Putin, and to argue for the continued existence of the EU. If this is nothing more than wishful “spin” for a gullible home audience (you and me), that is one thing If it is for real, however, the absurdity of it all should be obvious.

Yet again, it would appear, a UK Government is overestimating its influence with Washington – as, most egregiously, did Tony Blair – and chasing the fiction of that “special relationship” (which Obama in effect reassigned to Merkel). So far, Trump has shown that he is serious about what he said during his campaign, so it would be as well to prepare for the eventuality that he was also serious about Nato and engaging with Russia. And if he was, then the UK needs to take a hard look at its current security arrangements. Is there an alternative to the transatlantic alliance? Should there be? How valuable – remember Iraq and revisit Trump’s own scepticism – is the intelligence sharing, really? Or Trident, given the revelations of last weekend?