How can I avoid Undo/Redo on StringPropery or bpy.props in general?
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 = &quot;/tmp/test.txt&quot;

def get(self):
    f = Path(filepath)
    if f.exists():
        return f.read_text()
    else:
        return &quot;Default&quot;

def set(self, value):
    f = Path(filepath)
    f.write_text(value)
        
bpy.types.Scene.foo = StringProperty(
        get=get,
        set=set,
        )
        
def draw(self, context):
    scene = context.scene
    self.layout.prop(scene, &quot;foo&quot;)
    
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.