You don't need both len and i. And you don't need to retest bytes unless it changes. Suggest:

    int32_t min_continuation_bytes = static_cast<int32_t>(length - maxLength);
    if (min_continuation_bytes <= 0) {
        return true;
    }
    size_t i = length;
    while (--i) {
        if ((valueChars[i] & 0xc0) == 0x80) {
            if (--continuation_bytes == 0) {
                return true;
            }
        }
    }
    return false;