Usage of StringRef causes SEGV

Whenever I am interacting with LLVM and the IR system using StringRef, it leads to SEGV and a crash.
I am not able to create a Module, TargetTriple, Function or anything like that
More details along with a debug log can be found at https://github.com/llvm/llvm-project/issues/56224#issuecomment-1171247357