I have tried
print(context.active_object.name_full), but that seems to be just the object name that I see in the Outliner. If I change the name in the Outliner, then
name_full changes, too.
Is there any unique and invariable ID to identify an object at least within the session? That is, the unique ID should not be changed even if the user changes the object's name. The ID does not have to be same if the user opens the file again next time.