By default there will always be an empty string ( a DOMStringspecially ), and yes, you can rely on it without being null/ undefined.
The definition is really important here getAttribute():
Return Value DOMString
A value Attras a string or an empty string if this attribute does not have a specified or default value.
... it's really just an attribute that you throw back, so in both cases it is the same behavior, the interface just defines these attributes.
source
share