37mm.
I think Kennedy was a disaster, but #3 would have been considered “taking initiative” in most combat zones. As you state later, the cannon was lightweight. There is no info that it had any bearing on the sinking.
As already stated, early PT boats were lacking in gunfire for attacking barges and light boats. To the point that some were retrofitted as gunboats, no torpedoes, one of which Kennedy commanded after PT-109.
It was a cannon out of a P-400.Lendlease version of P-39.IIRC