c++: relax ref-qual overloading rules for C++20 [PR98939]
As explained in one of Tomasz's library papers P2438R2[1], C++20 allows
ref-qualified member overloads to coexist with non-ref-qualified ones,
but at the time of writing no compiler supported that. This patch
implements this C++20 relaxation so that we can in turn implement
P2438R2 as originally intended -- without needing to change the
signature of the main string::substr overload.