Schnapsidee is a wonderful German word. It describes an idea so ludicrous that several shots of brandy are required before one can see its brilliance. Fitting, then, that it was a German company – with Austrian assistance – that created the ultimate automotive schnapsidee: the Mercedes-Benz G-Class.

Styled like a dictator’s plaything, built like a proverbial outhouse and equipped with a properly luxurious cabin, this boxy, bonkers behemoth makes absolutely no sense at all. It has exposed hinges, the aerodynamic efficiency of an eiswagen and starts at £94,000 for the base model. Yet, 40 years since Mercedes first revealed its Range Rover rival to the world, the G-Class – or G-Wagen, as it was known until 1994 – continues to top countless motoring wish lists.

According to an oft-repeated legend, the idea – or, at least, the impetus – for the G-Wagen came from the Shah of Iran in the Seventies. Looking for something like the Mercedes Unimog, only a little easier for his military to park, he supposedly gave Daimler-Benz a call. Eager to please, the German firm jumped in with Austrian manufacturer Steyr-Daimler-Puch and crafted a Goliath wagon to meet his needs. Or so the story goes.

Alas, Mercedes isn’t too keen to elaborate on any Iranian connection today and, in any case, the Shah had other things to worry about by 1979. But whatever the genesis of the G-Wagen, the result was something spectacular. Tough enough to barrel through ditches and over dunes, sharp enough to handle and hustle on asphalt, yet comfortable enough to ferry passengers for long distances, it was, by definition, the ultimate utility vehicle.

Available in civilian or armour-plated military spec, with a long or short wheelbase and all sorts of body styles – from station wagon to drop-top – the press pack distributed at the 1979 launch touted the original Geländewagen (cross-country vehicle) as built for the “maximum variety of use”. And so it was: the first-gen G-Wagen served with fire departments, armies and Nato. It crossed continents with Gunther Holtorf and won the Paris-Dakar rally. It even got the papal seal of approval, acting from 1980 as the Popemobile.

So Mercedes’ mean machine was both capable and adaptable, but it was adaptability of a different kind that took the G-Wagen from state transport to transport statement. When the Range Rover showed the Seventies establishment that utility and suburbia were a match made in Kensington, it didn’t take Benz long to follow suit.

First came air-conditioning and Recaro seats, followed by electric windows in 1987. Then, in 1990, the upgraded 463 model arrived, offering buyers ABS, permanent all-wheel drive, three locking differentials and the option to clad the interior in sumptuous leather. And that was just the start.

Hitting the weighbridge at more than two tonnes, no amount of refinement could hide the G-Wagen’s heft. Shifting all that mass with any sense of alacrity required more power, so Mercedes stuck a V8 under the hood of the 500 GE in 1993. Then it made it bigger for the G500. Then, presumably several brandies down, the German firm gave the lunatics the keys to the asylum: in 1999, AMG got its hands on the G-Class.

The result was a deluxe SUV tuned to deliver 354bhp. By 2004, that had risen – courtesy of a supercharger – to 475bhp. Three years after that, total power output on the G55 AMG exceeded 500bhp, while the features list had grown to include cruise control, ESP, traction control and an even nicer cabin.

From diverse workhorse to opulent icon, the G-Class had defied logic to become an object of desirable excess – and the hype was real. Massively expensive special editions ensued, from the Maybach G 650 Landaulet (yours for upwards of £500,000) to the truly absurd six-wheel-drive G63 AMG 6x6.

Last year saw the 463 fully overhauled for the first time, with a completely fresh interior, independent front suspension, bigger dimensions and a mildly more efficient engine. Yet, even if Mercedes talks about “major facelifts”, the G-Class fundamentally remains the same – and that’s the key to its popularity.

It’s an unyielding anachronism that hasn’t substantially changed its brutal shell in 40 years, a machine of purpose transformed with a business class cabin, a track-ready engine and a price tag to mach – and it makes no apologies for any of it. Which, in an age of hybrid supercars and efficiency everywhere, is quite the statement.

Like a pair of Birkenstocks, the G-Class is objectively overpriced and brutal, bordering on ugly. Like a pair of Birkenstocks, it works on mountain slopes and city streets alike. And, like a pair of Birkenstocks, once broken in, nothing else will feel the same. Happy 40th, Geländewagen.