The greatest economist of the 20th century, at the least, John Maynard Keynes was required to write a book entitled How to Pay for the War. That was in 1940, when his services were needed more than ever. Serious advice for serious times. In the tragi-comic world of the Trump presidency Keynes might now be called on to author How to Pay for the Wall.

If it ever does get built, the Trump Wall, or however posterity will remember it, will be paid for first and foremost by the hard-pressed American taxpayer. Federal funds are required, which means they will have to come from taxation or from borrowing (i.e. future taxation). The sums involved are estimated to be somewhere between $8bn and $25bn. This is a lot of money, and could be better spent elsewhere, but in the context of the global total of US federal spending – $3.8 trillion, or $3,800bn – it is not going to be difficult to find the cash. The total cost of the wall, in other words, which will presumably take years to complete, represents just 0.65 per cent of a single year’s outlay.

Indeed, a Keynesian might say that it didn’t really matter where the money comes from if it is there to boost the American economy; a bit like when he advised British governments in the Depression to pay men to dig holes and then fill them in again. The money gets into the economy, and gets spent, and that’s the important bit.

Donald Trump's Mexico wall: At what cost, and how long?

But of course this is beside the point. This, typically for Trump, is about revenge, about having the last word, and about being seen to win. Thus, he requires Mexico to pay, even though only a proportion of the emigrants are Mexican, and even though there is very little the country can do to stop the flow. It is, after all, about economics; if people feel they can get a better life then they will take some considerable risks to get to it. The flow of migration may be re-directed, but it is unlikely to be stemmed. It also might become more violent than it is now – and dead people are a considerable economic cost, quite apart from any other considerations of simple humanity.

So President Trump can and probably will make Mexicans pay, though hardly fairly. If he slaps duties on Mexican goods, then the companies that make them or the farmers that grow them may not be able to recoup the tariffs/taxes by raising their prices. By the time a Mexican avocado gets to a New York deli to go into a brunch, it will be there competing for its place on the plate with other avocados from all over the world. Another 12 cents cannot be added without a loss of sales.

So the 12 cents, or whatever it is, is paid for by the Mexican farmer, out of his profits, not by the bruncher in NYC. The Mexican farmer’s workers will see lower pay, his own family less spending power. He may not be able to afford his annual holiday break in the US, or to buy US-made kit for the farm.

Much the same goes for VW Tiguan cars made in Pueblo, say, a more telling example. These cars show how globalisation has left Trump’s ideas way out of date. For a slump in the profits of VW Mexico would harm a company based in Germany, and maybe some managers and engineers working there, but it would also hit all those who own shares in VW Group – pension funds in Switzerland, in Japan and California, for that matter.

It might also rebound badly on US firms supplying components to VW to put into the Tiguans. What if those workers in the US are then laid off? And if Trumpery means that all production of small SUVs like the Tiguan for the US market move from cheap labour economies in South America and east Asia to the US again, then their cost and prices will certainly rise, though it will mean more jobs for Americans. That’s the essence of protectionism, and Trumpism.

The point is this: because so much economic activity is global nowadays the idea that one nation or one economy or one company can be “hit” with a tax or tariff with no reverberations across borders and continents is pitifully naïve – and dangerous. In that sense, the whole world, including Americans, will pay for the wall’s tariffs.

Alternatively, Trump could slap higher fees on Mexicans crossing the border legitimately (ironically). Again this would raise money – but only from those Mexicans directly affected, not the Mexican people as a whole. Few, one suspects, are the villainous people traffickers and drug dealers of Trump folklore. Thus it would be an unjust levy. Then again, fairness to Mexicans isn’t a slogan Trump has been much associated with.

The danger with all this is that it will spark a trade war with Mexico. The Mexicans would be hit hardest out of that – they need America more than America needs them, but it is still harmful and an example of how trade wars hurt everyone in the end. Mexicans will have less to spend on US goods and services; and they could retaliate by making travel from the US much more expensive. Then the tit-for-tat would spiral.

Geopolitically, the US shouldn’t want Mexico to go looking for friends and supporters elsewhere in the world, a sort of big version of Cuba or Venezuela. Besides, US corporations and consumers have done well out of the North American Free Trade Agreement, even if, which is admitted, many jobs have been exported south of the border.

The problem for America is not that it has been unable to generate new jobs – for it has done that impressively over the past quarter century. The problem, as in so much of Europe too, is that the new well-paid jobs are not in the places where the old jobs have disappeared. Too little attention has been paid to relocating enterprise to where there is unemployment and, frankly, making it easier for people to move to where the new jobs are, to offer them training and help with housing and schools.