In the latest film in the franchise, James Bond is no longer the irredeemable misogynist of old. And much of the credit for his conversion goes to Judi Dench's M

Judi Dench started life as M, the fictional head of MI6, by calling James Bond a "sexist, misogynist dinosaur". Oh how we cheered, us feminists sick of a long-running multibillion-pound franchise that left a series of beautiful women as little more than roadkill in the path of the spy we never loved. Seventeen years later, the great Dame seems to have left us with a film, Skyfall, we can all cheer. Or at least a proper female hero.

This statement may cause offence both to other feminists and die-hard fans who have long maintained that us laydeez can just go and talk on the phone while they enjoy the ultimate in male fantasy. Feminist author Bidisha once said: "Ian Fleming hates women and I don't buy into anything to do with that. The Bond films are generally sexist. I don't like anything that descends from a sewer of misogyny." And writer and broadcaster Fay Weldon said: "These characters were male fantasy figures. These films were attempts by men to keep women in their place and to ensure they still ironed their shirts."

The procession of women with ludicrous names (Pussy Galore: arf arf) and the patronising use of "girl", dreadful dialogue (some of which you can enjoy here) and ridiculous storylines have made me hate the whole idea of Bond. Until now.

The main cause for celebration is Judi Dench as M, the real hero of the film. Not only is she in charge but she shows both emotional power over her subordinates and human failure. She is no longer the joke older woman, there to act as the only foil to Bond's charms, but a real character with heroic traits.

When she first took the role in 1995 for Pierce Brosnan's Bond debut, GoldenEye, Dench's appointment was inspired by the rise to prominence of real-life MI5 boss Stella Rimington, who had recently become the organisation's first female director-general. Rimington retired in 1996, aged 61, after just four years in the top job. In Skyfall, Dench, who has had far longer in the fictional post, is judged to be past her best as the Whitehall mandarins try to edge her out. (I didn't miss the fact that the most hostile questioning from an ensuing committee-roasting comes from a female politician – as if the film's creators can't resist a bit of girl-on-girl action.)

Barbara Broccoli, one of the two co-producers, previously elicited derision when she called the Bond girls of the 60s "feminist role models" career women who were "sexual predators" giving as good as they got. With Judi Dench's M she has finally provided a role model. Without the sex. (I'm largely ignoring the oedipal overtones of Javier Bardem's villain.)

There are moments when the old Bond comes back in Skyfall. The film opens with a vehicle chase in which Bond laughs at Naomie Harris's driving skills (gasp, she knocks a couple of wing mirrors off while swerving at supersonic speed through rush-hour Istanbul) and then shows her less-than-sure aim with a gun. And, as Peter Bradshaw points out in his review, "the scene in which 007 steps suavely into the shower with delectable Sévérine (Bérénice Marlohe) could have happened at any time in the last half-century."

The backstory for Sévérine (spoiler alert), that of trafficking and abuse, also seems a bit of a turning point for Bond, although I'm no aficionado so forgive me if I'm wrong. Maybe the Bond women have all been victims of violence and I just wasn't listening while I shouted at the screen.

I can't help thinking that this shift in the position of women in the film (well, one film really) is part of the reason why Skyfall has had the biggest ever Bond opening and is on course to outpace 2006's Casino Royale (with $586m) as the most successful Bond film of all time at the box office.

Yet I'm sure many of the die-hard fans of the franchise will disagree. Even the Guardian's own Xan Brooks dissed the "touchy-feely indulgence" in Bond's childhood trauma and his relationship with a woman old enough to be (of course) his mother. "Don't they realise that 007 has always been at his most convincing when he's at his crudest and least adorned; when he's serving as a blank canvas for macho fantasy; the dark angel of our disreputable natures?"

I don't agree. I don't think it's good for boys or men to grow up thinking that misogyny and xenophobia are sexy (not to mention the idea that all baddies have a disability).

Perhaps my head was turned not on Saturday night when I saw Skyfall but 19 months ago when Dench and Craig teamed up to create the Equals video calling for equality. If you haven't seen it, watch it here.

In 2011, says the disembodied voice of Dench, a man is still likely to earn more for doing the same job and less likely to be judged for promiscuous behaviour. Hardly a ringing endorsement for a spy with money to burn and a string of lovers was it?

Some will argue that Bond is still awful for presenting a consumerist utopia where only the people with the money (to buy cars, computers, helicopters) can win. But that's a whole other piece. For now, will you join me in celebrating a sexy Bond with just a bit of the sexist left out?