Issue #21127: Path objects can now be instantiated from str subclass instances (such as numpy.str_).

Thanks to Antony Lee for the report and preliminary patch.
fix off-by-one error (closes #21330)