You should be able to just change the weapon class to "pistol" or "smg" in weapons.xtbl. Code does restrict the driver's weapon to those classes, plus "script", "thrown", and "sword" for motorcycles only (a holdover from SR2). This is unfortunately not tweakable behavior, so you can't just enable new weapon classes for driving.
I just changed the class of the gang shotgun to "pistol" on an SR4 build I already had ready, and that unlocked the shotgun while driving. As far as I can tell, the code that handles this hasn't changed, so I don't expect there to be a difference.
Changing the weapon class may have other implications beyond this, of course. I don't know what they all might be.
Are you having an issue with a specific motorcycle? That might also play into it.