No, pistols have their place, especially M4A3.
You can wear a pistol holster on suit storage and it's 6 magazine+1 pistol, now with how fast M4A3 shoots it is absolutely comparable to shotgun in self-defense.
All this while freeing up your webbing and armor storage for either more magazines or medical items.
Mod88 on the other hand has even more ammo and is useful against defenders, it's comparable to an shorter range M41 AP even. Though it does shoot slower if you need to shoo off a lurker which has the health pool to shrug it off so a medic has less use for them compared to M4A3.