This is probably an overly simplistic solution, but a lot of weapons have two use modes that you can switch with the x key, mostly for using throwing weapons as either melee or thrown weapons. Could a switch for spears between the current "normal" mode and maybe a higher up grip that sacrifices reach for speed in close combat? Combined with the polearm push perk, that could be a fun technique that the AI could also use: short range stab-push, switch to long range grip, harder stab. Would also make spearmen more effective by allowing them to slow down and control enemy infantry advances, make infantry spear length matter, and generally make unit cohesion more important.