To me, I would prefer it was made basically unrewarding no matter the situation to go into melee. Seeing as it has been implied that will be impossible, here are a couple other suggestions I have for melee itself:

-Reduce usage of the bayonet, E.G. make it so even with bayonets fixed, besides an initial charge, clubbing will be much more popular than bayoneting and will not be a one hit kill either, possibly even taking a good 3 wooden smacks to knock out an enemy. This could be accomplished by making bayonet thrusts easily, easily parry-able. Or just the attack itself being randomized in type with a preference to clubbing.

This is based on historically sources, at least the ones I've seen, as well as Civil War research in general, I can't find evidence that bayonet victims outnumbered or equal clubbed victims.

-"Suppression" in melee?
Sounds pretty weird, though it would be yet another incentive to reduce melee without destroying it. Suppression would theoretically keep melee quick and decisive, else the winners (or losers, if they live) will be more or less unable to fight for a good 20 seconds or so after the combat or during it.

-Sticks!
https://youtu.be/888_Gxybdtw?t=236