docs: @SuppressWarnings("PMD.AvoidCatchingThrowable")
    private static String newString(char[] buf) {
      if (STRING_CONSTRUCTOR != null) {
        try {
          return (String) STRING_CONSTRUCTOR.invokeExact(buf, true);
        } catch (Throwable t) {
          // Note: `invokeExact` explicitly throws Throwable to propagate any exception of the
          // method unchanged. For our purposes we just fallback to the string constructor.
          return new String(buf);
        }
      } else {
        return new String(buf);
      }
    }