Funny you should ask that - in the latest collection of scraps from the Prof’s wastebasket unearthed years later by his family, there turns out to be a fragment from the early 1930s when he was still drafting The Hobbit, and there are references to Bongo (as Bilbo was then called - the name was changed before publication) catching a whiff of old damp clay in the dark, and hearing some muttering in what the reader might recognise as Yiddish. Of course the joke would have gone over his younger readers’ heads but Tolkien does that sometimes - he puts a gag into what’s supposedly a story for children, but which only an adult would actually “get”.
In that early draft Bongo is indeed cornered by this creature who can only remember that his name is “Gollum” and, in an inspired move, leaps up onto his shoulders, levers the top of his head off, and snatches out the chem, the engraved scroll that bears Gollum’s words of power, thus deactivating him. But Tolkien seems to have been advised that this wouldn’t play too well, especially given the growing tide of Nazi anti-Semitism that was colouring the waters of Europe most unpleasantly by the time The Hobbit was published in 1937, so he revised this section extensively.
By the time LotR was written, Tolkien had retconned this section yet again. He now needed Gollum, previously an indeterminate “monster in the dark”, to be hobbit-like, and took the unusual step of changing a lot of the chapter “Riddles in the dark” even after the book had been in circulation for years. With that change the last vestiges of the horrible clay-monster of the Misty Mountains vanished for good.
JRRT 1st used the term “gwerlum” to describe a spider-like creature in some of his very early writings. In the Sindarin language he created, it means “gloomweaver”. This may be seen in his Book of Lost Tales, volume 1 which contains writings of his from the Great War into the 1920’s, IIRC. He later discarded this term and referred to the spider as Ungoliante.
I’m not sure when he started using the term ‘gollum’. I’ve not yet got my copies of “History of The Hobbit” (AKA HOTH), just recently published in 2 volumes.