In-universe, the explanation is simple: The Hobbit was Tolkien's translation into English of the original material from Common Speech, since the plot device is that both The Hobbit and LOTR are the writings of Frodo and Bilbo, that he (Tolkien) had access to and translated.
The Common Speech, as the language of the Hobbits and their narratives, has inevitably been turned into modern English. In the process the difference between the varieties observable in the use of the Westron has been lessened. Some attempt has been made to represent these varieties by variations in the kind of English used ... (LOTR: The Return of the King, Appendix F, "II. On Translation")
As such, it's a common thing with the translators to employ idiomatic translations instead of literal - and as a linguist, Tolkien surely was familiar with translation techniques.
As other answers noted, both Tolkien himself, as well as his intended audience (English speaking people of 20th century) knew what "like drums and guns" sounded - probably a lot better than whatever idiom was used by Bilbo in the Common language. So, this is a very valid approach to the text.