As reported in https://github.com/llvm/llvm-project/issues/40363, the exclude_from_explicit_instantiation attribute doesn't currently really work with dllimport.
Because of that, the new stringbuf::str() overload added in D153709 is dllimport on Windows but not actually defined in the cpp file, causing link errors.
As discussed on that code review, this patch works around the problem with the always_inline attribute until Clang can be fixed.