While it is hard enough to make a straight-forward genre film, it is much more difficult for a director to attempt to send that genre up: make it too broad, and it descends into an unamusing mess; too narrow, and it becomes a smug attempt to show off the creator’s smarts. With this in mind, you would be forgiven for having a shudder of apprehension before seeing The Nice Guys, the latest work from director and writer Shane Black, which attempts to skewer neo-noir films, buddy comedies, and the 1970s simultaneously. But Black manages to pull it off, supported by the strong cast, to make The Nice Guys a light, buoyant piece of entertainment.

To say that The Nice Guys is in on the joke of the genre tropes would be a massive understatement. The film sets out its mission statement in its opening: a young boy sneaks into his parents room to steal his father’s Playboy lookalike only to be interrupted when a car crashes off one of the iconic ridges of the San Fernando Valley, directly into his home. Upon examination of the crash, the kid finds adult film actor Misty Mountains (Murielle Telio) naked, bloodstained, and writing on rock, offering up the beguiling last words “How do you like my car, big boy?” It’s an indicator of the time (late 1970s) and place (Downtown L.A.) so immediate the opening titles are redundant.

This scene, with its sexual objectification dripping in casual violence, sets the tone for the duration of the two-hour-long film, which takes several cues from Paul Thomas Anderson’s superlative 1997 work Boogie Nights, another film set around the porn industry of 1970s LA. Those taking the scene at face value would be rightly offended, but soon it becomes clear just how much of a parody The Nice Guys is, and how everyone – the director, the cast, the audience – are in on the joke. The crash scene is followed by another collision, this time between the two principles: Holland March (Ryan Gosling), the down-and-out alcoholic PI who litters his rented apartment with scotch bottles following his wife’s death; and Jackson Healy (Russell Crowe), an enforcer heavy who just wants to feel useful. March has been hired to investigate the reappearance of Misty, seen by her myopic aunt, and ties it in with the disappearance of Amelia Kutner (Margaret Qualley); Healy, meanwhile, has been hired by Kutner to try and keep her whereabouts unknown. The result is Healy turning up at March’s door, and breaking his arm, almost in front of his 13-year-old daughter Holly (Angourie Rice).

In the real world, that would be the end of it (and at some point the police would get involved – they never really seem to do so; perhaps the LAPD’s funding was cut that year), but because we are in neo-noir world, a different set of rules apply. After Healy is assaulted in his office by two gun-toting goons looking for Kutner, he teams up with March to try and track her down before she is killed. What follows is a classic screwball-style buddy movie: Healy’s seasoned professionalism clashes with March’s uncontrollable alcoholism – while the former cases a joint looking for witnesses, the latter just tries to find out where the free bar is. Healy is disgusted by March’s readiness to exploit his needy clients, but is perfectly willing to kill those in his way, a fact pointed out by Holly, who is the moral centre of the piece.

Crowe gets his teeth stuck into his role, bringing a sense of defeated nobility to Healy, a man blown along by the vice-filled wind of L.A. He plays Healy completely straight, taking cues from the serious noirs of the 1940s and 50s. Gosling, in contrast, was clearly having a complete ball during the filming, and his infectious comedic energy colours every scene he is in. After a run of heavy, serious films, Gosling is showing us that he still retains the comedy chops on show in Crazy, Stupid, Love and Lars and the Real Girl. An effective comparison may be drawn with Nicolas Winding Refn’s 2011 thriller Drive, another L.A.-based neo-noir centred around a nostalgic time period (while set in the present, Refn’s film is heavily laced with 80s overtones); while Gosling was near-mute in Drive, communicating only through body language, in The Nice Guys he attacks the dialogue at full throttle, chucking out smart quips like a circus knife-thrower. He also skewers Crowe’s over-the-top dialogue, which is pure neo-noir ham: all dramatic metaphors and grizzly anecdotes. At one point, Healy makes reference to a character “dropping off his radar”, and March openly scoffs the use of such a po-faced term, revealing the ludicrous nature of the predictable dialogue often found in a neo-noir.

The Nice Guys would work solidly as a straight neo-noir piece, one that is enjoyable but ultimately forgettable. However, it is the way in which Black has approached the project, with his tongue firmly in cheek throughout, threading the scenes with a heavy skein of irony, that elevates this above standard fare. There are certain elements that feel uneven – particularly the way Black seems to be taking inspiration from every decade between the 40s and the 80s – and a number of fight scenes could be cut: they were clearly supposed to be dramatic centrepieces, however, where the film shines is the dialogue, and these parts only seem to bloat the film. But look past these, focusing on the chemistry between Gosling and Crowe, and the razor-sharp screenplay, and The Nice Guys is a rough gem of a film, shining through the L.A. smog.