Boris Johnson is the first British prime minister since Winston Churchill to have made his living by writing, producing half a dozen books and hundreds of newspaper columns that have earned him millions of pounds over the years.

His books include a life of Churchill, popular histories of London and the Roman empire, a memoir of his first general election campaign and a comic novel set in the House of Commons.

Each of these is revealing in its own way about Johnson’s attitudes and enthusiasms but it is his three decades of newspaper writing that provide most clues about the political outlook of Britain’s next prime minister.

What emerges is a social liberal with deeply conservative manners and prejudices, a pro-American foreign policy hawk who is squeamish about the reality of war, and a tax-cutting Tory who likes to splash the cash around on popular initiatives.

“Lefties are fundamentally interested in coercion and control, and across British society you can see the huge progress they are now making in achieving their objectives: in the erosions of free speech and civil liberties that are taking place under this government, in the ever more elaborate regulation of the workplace, the bans on hunting, smacking, smoking, the demented rules about the numbers of children you may take in a swimming pool, the proposed plan to tag your car to see where you have been,” he wrote in February 2006.

Then Daily Telegraph columnist Boris Johnson in 2000. Photograph: Neville Elder/Corbis via Getty Images

‘Elf and safety’

The absurdities of the nanny state and what he calls “elf and safety” are a staple of Johnson’s columns, which portray an over-anxious, interfering government driving the joy and spontaneity out of life. A 2007 column about school playgrounds begins with a nostalgic rhapsody about “our childhood Elysium” watching a scab healing.

“First the outer edges would harden, leaving a raw red patch still faintly weeping in the middle. Then the whole thing dries into a miraculous integument, as firm and knobbly as the edges of a bit of cheese on toast. You could tap it. You could stealthily probe its edges, with the connoisseurship of the man from Del Monte, to see if it was ready. Then one day it would all be gone, and we saw the skin underneath, pink and new and whole,” he wrote.

Johnson’s point was that instead of making the surfaces of playgrounds soft and spongy, the state should make the streets outside safer for children to play in. He returns again and again in his columns to the importance of safe streets, calling for more police on foot patrols and praising “have a go heroes” who intervene to stop criminals or to stand up to street bullies.

When Johnson advances a liberal argument, it is often in the most offensive, illiberal language, as he did in his notorious column describing Muslim women wearing the burka as “looking like letter boxes”. The column was arguing against Denmark’s ban on the burka but that argument was lost in the ugly language he used.

Martin McGuinness interview

Much of the offence Johnson has caused over the years has less to do with his opinions than his casual displays of prejudice, such as transliterating the speech of foreigners or those who don’t speak like him. It appears to be an almost irresistible urge, as he demonstrated in a 2000 interview with Martin McGuinness:

“How does it feel to come to work every day under the salute of Carson, to be a member of the British government? ‘No, I’m not actually – uctually – I don’t swear an oath of allegiance to anyone other than the people who elected me.’ This is still part of the UK, isn’t it? ‘Well, the British – the Bratash – tell us it is, but we want to change that’.”

Despite his distaste for McGuinness, Johnson concludes that the British government was right to deal with him and that Sinn Féin and the IRA had won “the long struggle of wills” with London.

The launch of Boris Johnson’s book The Churchill Factor: How One Man Made History in London in 2014. Photograph: David M Benett/Getty Images

“The best hope now and of course it is morally bankrupt, but not wholly despicable – is that the ‘peace process’ should grind on, the executive return, and Martin and his kind lose their instinct for terror, and discover the delights of spending taxpayers’ money on schools, and riding in Rovers paid for by the state he would destroy,” Johnson wrote.

An enthusiastic champion of Britain’s “special relationship” with the United States, Johnson supported the 2003 invasion of Iraq. But on a visit to that country after the war, he was unsparing in his criticism of the allied reconstruction effort and frank about the misery and fear in which Iraqis lived.

Four years earlier, in a series of angry despatches from Belgrade, Johnson condemned Nato’s 70-day bombardment of Serbia.

“You might defend the air war if it was somehow stopping Serb forces from launching brutal purges in Kosovo. But that is just what it is not doing. Quite the reverse,” he wrote.

“If and when there is a Nato ‘victory’, and Blair and Clinton are paraded in triumph, then I hope there is a man behind them on the chariot to whisper in their ears, not only of their own mortality but also of the mortality of the people they claimed to be protecting”.

Inconsistency as strength

Johnson’s libertarian streak is reflected in his advocacy of low taxes but his columns also call for more opportunities for disadvantaged young people and he is enthusiastic about big, expensive infrastructure projects. He cherishes this inconsistency as a strength and during the 2001 Conservative leadership contest he was contemptuous of those who spoke about a battle for the party’s soul.

“There is no such thing. The Tory party is a vast organism animated by a few vague common principles such as tradition and love of country, and above all by the pursuit and retention of power,” he wrote.

Many Conservatives who voted for Johnson in the leadership election did so in the hope that he would cheer the country up after three years of Theresa May and Brexit misery. It’s a quality Johnson admires in other politicians and when he visited Silvio Berlusconi in Sardinia in 2003, he fell immediately under the old rogue’s spell.

“It is hard not to be charmed by a man who takes such an interest in cacti and who will crack jokes at important EU gatherings, not only about Nazi camp commandants but also about whether or not his wife is running off with someone else,” he wrote.

“Suddenly, after decades in which Italian politics was in thrall to a procession of gloomy, portentous, jargon-laden partitocrats, there appeared this influorescence of American gung-hoery. Yes, he may have been involved in questionable business practices; he may even yet be found out and pay the price. For the time being, though, it seems reasonable to let him get on with his programme.”

When Johnson walks through the shiny black door of 10 Downing Street on Wednesday, he will have realised an ambition that has driven him for 40 years. But he knows that this triumph is only one stage in the unforgiving cycle of political life, as he observed in June 1997 following the resignation in disgrace of former Conservative minister Jonathan Aitken.

“Politics is a constant repetition, in cycles of varying length, of one of the oldest myths in human culture, of how we make kings for our societies, and how after a while we kill them to achieve a kind of rebirth – as Tony Blair would put it, new life for Britain,” he wrote.

“Some of the kings are innocent; indeed, some of them take away the sins of the world. Some of them are less innocent, like Mr Aitken. It doesn’t really matter. They must die.”