John Gilbert, via intertitle, shouted “goddamn it” and “b------s!” (sic) during the heat of the battle in the hugely successful The Big Parade (1925).
In the closing line of the exotic The Green Goddess (1930), George Arliss, as a Asian tyrant, dismisses a woman who escaped his clutches with the comment, “She probably would have been a damned nuisance, anyway.”
Another World War I epic, Hell’s Angels (1930), really let it rip: you could hear “It’s me, goddamit”, “What the hell”, “For Chrissake”, “Jesus!”, and “That son-of-a-bitch!” amid the aerial dogfights.
Even after the Motion Picture Production Code began to be enforced in 1934, there were pre-Gone With the Wind uses of “damn”, including Katharine Hepburn quoting Lady Macbeth’s “Out, damned spot” in Holiday (1938). The earliest Code-era “goddamn it” I know of was from Don Murray in Bus Stop (1956).
Scott Wilson was the first to say “shit” in an American feature, as one of the murderers in In Cold Blood (1967).