Toggle whether @HideInInspector takes effect.

Looking for a way to do this for variables in a class.

You can’t without recompiling. You could put the @HideInInspector inside a #if SOMETIMES_VISIBLE and then use the Player Settings to set or unset that define. You can always view @HideInInspector fields if you switch the inspector to Debug mode.