I'd guess most of it had to do with signalling. While sound may not carry far in a jungle it'll do better than line of sight.

Second, most European and American troops of the day had the attitudes of the day -- they tended not to trust the "natives". They wanted to have a firearm present so that any locals would be deterred from any free-lance socialism. How Neanderthal. [That this had happened more than once is, of course, irrelevant. /sarc]

I visited a PT boat site (PTboats.org) which has a few actual veterans posting. IIRC all deck crew wore holstered sidearms. This was not to repel boarders but for signalling -- you had a real chance of being thrown into the water in action as you were often NOT tied onto the boat and the boat tended to move fast & in unpredictable ways . . . If you fell into the dark Pacific at night you had almost zero chance of being picked up unless you could signal and you could hear a .45 for hundreds of yards.