This module for Foundry VTT allows you to replace NPC names with an alternative of your choice. You can choose to hide names for friendly, neutral, hostile, and secret dispositions independently. You can toggle the name of a specific actor manually by clicking the reveal button next to their name.
If you want more direct control over a specific actor, open its actor sheet and click the mask icon in the upper left corner.
This will open a menu that allows you to set the hidden state of the actor and to override the replacement name.