Make llvm::StringRef to std::string conversions explicit.

This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.
diff --git a/lld/ELF/Symbols.cpp b/lld/ELF/Symbols.cpp
index 4956e27..f5d5ca1 100644
--- a/lld/ELF/Symbols.cpp
+++ b/lld/ELF/Symbols.cpp
@@ -28,7 +28,7 @@
 static std::string demangle(StringRef symName) {
   if (elf::config->demangle)
     return demangleItanium(symName);
-  return symName;
+  return std::string(symName);
 }
 
 std::string toString(const elf::Symbol &b) { return demangle(b.getName()); }