Unfortunately, that will just result in four (!) other warnings:
The property "health" is not present on the inferred type "Node2D" (but may be present on a subtype).
<GDScript Error>UNSAFE_PROPERTY_ACCESS
The method "has_method()" is not present on the inferred type "Variant" (but may be present on a subtype).
<GDScript Error>UNSAFE_METHOD_ACCESS
The property "health" is not present on the inferred type "Node2D" (but may be present on a subtype).
<GDScript Error>UNSAFE_PROPERTY_ACCESS
The method "call()" is not present on the inferred type "Variant" (but may be present on a subtype).
<GDScript Error>UNSAFE_METHOD_ACCESS
If it’s really impossible to ‘fix’ these warnings, why are they warnings in the first place? Seems rather strange to build a script language and give the user they can’t do anything about…