Setter and getter saving data outside blend file data.
Suggest this could be done with a setter / getter. For example could append string property to a text file, which would be outside the influence of the blend file data (undo stack.)
Here is a test example, using a hardcoded filepath to a text file. The property is prepended to the text editor footer to test.

import bpy
from bpy.props import StringProperty
from pathlib import Path
filepath = "/tmp/test.txt"
def get_foo(self):
f = Path(filepath)
if f.exists():
return f.read_text()
else:
return "Default"
def set_foo(self, value):
f = Path(filepath)
f.write_text(value)
bpy.types.Scene.foo = StringProperty(
get=get_foo,
set=set_foo,
)
def draw(self, context):
scene = context.scene
self.layout.prop(scene, "foo")
bpy.types.TEXT_HT_footer.prepend(draw)
Note: This is solely a proof of concept. Would require a blend file name based filepath, or in file data for different values on a per blend basis.