Tallulah Bankhead's sexual appetites in the Golden Age of Hollywood were well known.

There's a moment in the Sacha Baron-Cohen film Brüno in which the hero, at a low ebb, has a revelation about why stars like Tom Cruise and John Travolta have succeeded in Hollywood where he has failed – they're all heterosexual. It's a sly, lawsuit-proof way of commenting on the popular suspicion that Tinseltown is in fact full of gay stars who, despite wider social change, have chosen to remain in the closet. What's less well known is that Hollywood has always functioned this way, with rumours circulating wildly even in the days when America locked people up for homosexual behaviour. As February is gay and lesbian history month, it's time to pull back the curtain of secrecy and take a look at the hidden lives of some of Golden Age Hollywood's most influential women.

Introduced in 1930, the Hays Code restricted Hollywood's output for 38 years. Parts of it were inspired by a social backlash against the anything-goes culture widely believed to dominate the early industry, in which stars like Louise Brooks, Tallulah Bankhead and Dolores del Rio barely bothered to keep secrets and frequently appeared in films that traded on their reputations as sexually assertive women with wide-ranging appetites. “My father warned me about men and booze but he never mentioned a word about women and cocaine,” said Bankhead, who had a turbulent and poorly concealed affair with writer and bit-part actress Mercedes de Acosta. The code would go on to constrain the lives of other stars, though several continued to rage against it and get away with as much as they could. In the Fifties, the purges organised by Senator Joseph McCarthy, most famously against Communists, also targeted gay, lesbian and bisexual people and drove some out of the industry permanently.

The Hays Code expressly forbade 'any inference of sex perversion', which its creators believed would automatically be interpreted as inclusive of homosexual behaviour. It drew on the Hicklin Test, established in England in 1857 to control the book publishing industry, which held that material was obscene and could be destroyed if it had a tendency 'to deprave and corrupt those whose minds are open to such immoral influences, and into whose hands a publication of this sort may fall' (the reason why the judge who later ruled on Lady Chatterly's Lover asked his jury if they would let their servants read it). This meant that not only were scenes that implied lesbianism forbidden, but a film could be vulnerable if it featured a close female friendship between actresses widely believed to have such tendencies themselves, as an audience might then infer a sexual element.

This made things very difficult for lesbian and bisexual actresses. Marlene Dietrich, who had fled Nazi Germany in part because of her sexuality and the sympathy it gave her for other minorities, refused to be cowed by it. In Morocco's famous cabaret scene she argued that, because she was cross-dressed, kissing a girl was an entirely natural thing to do – a heterosexual gesture. This wasn't the only occasion when that excuse was used, with Greta Garbo as Queen Christina kissing one of her ladies in waiting whilst disguised as a man. Garbo's famously aloof personality kept her safe from challenges about her sexuality despite the proliferation of rumours. In 1960 Mercedes de Acosta published a memoir in which she claimed they had enjoyed a 15 year relationship, but Garbo, by then living in retirement in New York City, declined to comment. Louise Brooks, Tallulah Bankhead, Eva le Galienne and Lilyan Tashman also claimed to have had affairs with her. But if Garbo loved a woman, it was probably the Swedish actress Mimi Pollak, her 'little Mimosa', with whom she said she had always felt she belonged.

Despite her own situation and her defiant, if lonely, summing-up of it as “we cannot help our nature, as God has created it,” Garbo refused to be involved with the cover-ups or 'lavender marriages' frequently arranged to disguise the inconvenient sexuality of other Hollywood stars; she outright denied, for instance, having been involved with gay actor Cecil Beaton. The great film noir actress Barbara Stanwyck married gay actor Frank Fay and continued her affairs with women. Jean Acker married Rudolph Valentino so she could hide her bisexuality and he could hide his gonorrhoea. Gone With The Wind star Ona Munson, widely believed to be lesbian, was married three times before she committed suicide at the age of 55. And silent star Alla Nazimova had a long 'romantic' association with gay actor Charles Bryant as her cover story, but became increasingly frustrated with staying in the closet. Eventually, in a spectacular act of rebellion, she produced an all-gay version of Oscar Wilde classic Salomé, which destroyed her career but which is still admired to this day as a superb piece of cinema.

Marlene Dietrich, one of Hollywood's most iconic women

For those who wanted to stay in the system but still live their lives with a degree of honesty, there were what Marlene Dietrich described as 'sewing circles', a system of just-under- the-radar social events that enabled lesbian and bisexual women to meet in a safe environment. They evolved from Alla Nazimova's legendarily debauched parties and, among other things, were the place where Nazimova and Jean Acker became involved with one another. Other stars took sojourns to Paris, where the atmosphere was much more liberal and it was – odd though this may seem to modern readers – relatively easy to escape the attentions of the press.

Another way to live openly with reduced risk was to play everything for laughs, so that censors could never be sure if they should take the rumours seriously. This was the path chosen by the likes of Frances Faye, who also had to contend with prejudice because she was disabled and Jewish; and Patsy Kelly who, when she ceased to make money as a comic actress, was employed as a maid by Tallulah Bankhead so the two of them could live together without interference.

As with so many other secrets in Hollywood, sometimes the best way of all to preserve them was simply to be so famous that the studios couldn't afford to lose their investment. At the height of her career rumours were rife about Katharine Hepburn (though the evidence suggests she was probably straight) but she was so popular with audiences that she never suffered as a result. Similarly, Joan Crawford remained at the top of her profession despite affairs with several well known women including Marilyn Monroe. And Agnes Moorhead was so highly valued as a character actress, and so well respected by her fellow professionals, that her career thrived for decades despite her being not only lesbian but very visibly a butch dyke.

It's hard to imagine what Hollywood would have been without the contributions made by these women and others who faced similar challenges. Though the truth of their lives has been hidden, their onscreen work has made them immortal.