[libc++] Implement LWG3662 basic_string::append/assign(NTBS, pos, n) suboptimal (#206320)
Closes https://github.com/llvm/llvm-project/issues/189809
This patch implements LWG 3662 and adds the related functional and
nonnull tests.
---------
Co-authored-by: A. Jiang <de34@live.cn>