This define allows builders to opt in to a version of _LIBCPP_ASSERT that
crashes fast in production builds, with the smallest possible object code.
Builders who do not define _LIBCPP_HARDEN, and builders who use
_LIBCPP_DEBUG_LEVEL >= 1, will see no change.
Also, add an assert in constexpr string_view::operator[].
Checking that size() == 0 seems like a mistake, as otherwise you would allow arbitrary indices for an empty string_view. This should just be _LIBCPP_ASSERT(__pos < size(), "..."); unless I'm missing something obvious.
Given that string_view implies C++17 or newer, you should also be able to use multiple expressions in a constexpr function. IMO the following is easier to read: