in godot, use an autoload. an autoload is a singleton created by godot, it generates a single node at the root that persists between scenes.
it can be accessed from any node.
I would question the reason for this code to exist, a singleton is used for an object that needs to be the only instance of a class, and health is usually part of a character, and you have many in a game at a given time.
I would add that you should not worry about performance, that’s premature optimization, it’s a waste of time.