Properties, the Defaults for Property keys, and when to use get()
The default value will not be automatically applied when declaring a property with a getter and setter.

In Python you can use the .get() function when accessing a key in a dictionary that may not exist. It allows you to specify a second argument which will be used as default value in case the key cannot be found. This is necessary for your use case, because the key "enum_flag_var" may not yet exists in the bpy_struct dictionary. Accessing it using self["enum_flag_var"] will result in a KeyError.

KeyError: 'bpy_struct[key]: key "enum_flag_var" not found'


The key will exist once you've assigned a value to the property in your script or when the user sets a value in the UI. You cannot use self.property in the getter, because that would in turn also call the getter and therefore cause an infinite recursion. That's why the value is accessed through the dictionary.