https://lemire.me/blog/2024/07/26/safer-code-in-c-with-lifetime-bounds/
Some newer versions of clang support annotating methods with an attribute that indicates they return data whose lifetime is bound to the containing object instance, and that holding pointers to such data is not safe if those pointers will outlive the object.
In string_theory, I believe that would be the case for the c_str() and data() methods on char buffers, and also c_str() on ST::string (and probably others but those were the obvious ones that came to mind).
It might be worth adding those annotations (conditionally when using a compiler that supports them).