newer games? i can only speak for Skyrim if that is of interest, but that uses a face sculpturing machanic, so it's set up completelly different.
anyway, the main heads are all bald and you chose which hair you want to use in the character creation process.
for the helmets flags exist which hair parts it coveres (complete head, hair (upper) or hair (long/lower, like pony tails)). then you just flip the flags in the toolset for each helmet, that works the best based on the helmet mesh (i.e. diadems show everything, hoods cover the long hair, tight fitting helmets cover long and upper hair and full helmets cover the whole head.) also, different options are implemented for different races (e.g. cat like races with lots of hair on their head might hide their upper hair, when human races might still show it on the same helmet)
so it's built into the game from the ground up. to get anything like it working in NWN first bald heads would be needed, and hair as vfx. and it should be possible to apply hair and helmet vfx simultaneously.
edit: another idea: transparent hair color maybe? an then when a helmet vfx is applied, that needs to hide the hair, the color is automatically changed to transparent, and back again after removal. this might be a solution that is doable by scripts alone, maybe (without tediously splitting all head and hair on a mesh level first)