Hey Knovolt,
In your Player Controller (or wherever you are receiving input for your character), you can use Set Hidden in Game node to toggle whether a Component is hidden during play. You could set up something like this:
This will Cast to character Blueprint, get component you want (in your case, your Head mesh), and set it Hidden. I’m using a Bool variable (default value as false) and setting its negative every time, so while H is pressed mesh is hidden, and when H is released it becomes visible again.
You can decide whether an Actor or Component casts a shadow while Hidden. In this case, I found mesh component of my character’s Blueprint and scrolled down to Lighting in Details panel. If you expand that section, you’ll find Cast Hidden Shadow. Enable that, and a shadow will be cast whether it is hidden in game or not.
Hope that helps!