[libc++][NFC] Refactor string's extern template lists (#137264)

This patch moves the functions common between our two extern template
lists into a common list and avoids some unnecessary _Uglification. This
makes the code a lot nicer to read and makes the differences between the
two lists obvious.
diff --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp
index e335639..55d19a6 100644
--- a/libcxx/src/string.cpp
+++ b/libcxx/src/string.cpp
@@ -75,7 +75,7 @@
 
 #endif // _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
 
-#define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template __VA_ARGS__;
+#define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template _LIBCPP_EXPORTED_FROM_ABI __VA_ARGS__;
 #ifdef _LIBCPP_ABI_STRING_OPTIMIZED_EXTERNAL_INSTANTIATION
 _LIBCPP_STRING_UNSTABLE_EXTERN_TEMPLATE_LIST(_LIBCPP_EXTERN_TEMPLATE_DEFINE, char)
 #  if _LIBCPP_HAS_WIDE_CHARACTERS