Description: revert the string formatting overhead.
 Basically a partial revert of this: https://github.com/pytorch/pytorch/pull/76977
 we encountered a strange FTBFS issue when compiling against libfmt.
 reverting back to c++ std and try again.
 This patch is not yet verified.
diff --git a/torch/csrc/Exceptions.cpp b/torch/csrc/Exceptions.cpp
index 5210d6f7..d0dfbc89 100644
--- a/torch/csrc/Exceptions.cpp
+++ b/torch/csrc/Exceptions.cpp
@@ -259,15 +259,10 @@ PyWarningHandler::~PyWarningHandler() noexcept(false) {
       } else {
         // Lets Python set the source location and puts the C++ warning
         // location into the message.
-        fmt::memory_buffer buf;
-        fmt::format_to(
-            buf,
-            FMT_STRING("{} (Triggered internally at {}:{}.)"),
-            msg,
-            source_location.file,
-            source_location.line);
-        buf.push_back('\0');
-        result = PyErr_WarnEx(PyExc_UserWarning, buf.data(), 1);
+        std::ostringstream os;
+        os << msg << " (Triggered internally at  " << source_location.file;
+        os << ":" << source_location.line << ".)";
+        result = PyErr_WarnEx(PyExc_UserWarning, os.str().c_str(), 1);
       }
       if (result < 0) {
         if (in_exception_) {
