### Godot version

4.0 beta17

### System information

Windows10

### Issue description

call `"".split()`
Is there an infinite loop inside? Function does not return.

### Steps to reproduce

"".split()

### Minimal reproduction project

N/A
if (is_empty()) {
		return "_"; 
	}
	String result = *this;
	int len = result.length();
	char32_t *buffer = result.ptrw();
	for (int i = 0; i < len; i++) {
		if (!_is_valid_identifier_bit(i, buffer[i])) {
			buffer[i] = '_';
		}
	}
	return result;
}
bool String::is_valid_identifier() const {
	int len = length();
	if (len == 0) {
		return false;
	}
	const char32_t *str = &operator[](0);
	for (int i = 0; i < len; i++) {
		if (!_is_valid_identifier_bit(i, str[i])) {
			return false;
		}
	}
	return true;
}
bool String::is_valid_string() const {