Given the dubious utility of a handgun in military service, I'd say drop the gun entirely, and give everyone M4s.
Isn't that what the M1 Carbine was all about? Frankly, despite attempts to rid the battlefield of the pistol, it soldiers on. It is used offensively, defensively, for jobs where continually being out of reach of the rifle or having to constantly resling it is a problem, and sometimes it is just a security blanket.
Still, the pistol is a very serious combat arm. Whether house clearing, cave and tunnel clearing, or other CQB situations where space or tactical movement is a problem like in boarding ships (where, in my own experience, I preferred an M1911 to anything else in our small arms lockers quite frankly), silenced use offensively, and other employments, the pistol remains very viable.
If they were so lacking in utility, why haven't Delta, the SEALS, MEU/SOC, tankers, pilots, MPs, sailors, and others given up on them yet? The "battlefield" is not always the one where the M4/M16 would be the best choice. Heck, the shotgun still soldiers on for certain applications despite its limited range. So why do a lot of soldiers who would not normally be issued a pistol sometimes make extraordinary attempts to get one? Why are they the most common small arm in general use in the Navy? Why did Marines houseclearing in Iraq demand more pistols in front line units? Because you don't always get to choose where your enemy will be and no one weapon can cover every contingency.
Despite the advent of subguns, PDWs and the like, the pistol persists. The issue has probably been definitively settled. Portable lethality in a small package is hard, if not impossible, to replace. It is likely that since it hasn't been replaced by now, the handgun never will be by anything that fires through chemical reaction.