### Godot version

8449592d92eaeef990f5502b419d491ee3eeb7a6

### System information

Windows 11

### Issue description

Zooming in the script editor on an empty script freezes the entire editor for a few seconds, but if the file is large then it freezes for 4-5 seconds (which is unacceptable). Looks like a recent regression.

### Steps to reproduce

Just zoom in/out on the large script file.

### Minimal reproduction project

N/A
const String lang = (p_language.is_empty()) ? TranslationServer::get_singleton()->get_tool_locale() : p_language;
	// Convert to UTF-16.
	Char16String utf16 = p_string.utf16();
	PackedInt32Array ret;
	UErrorCode err = U_ZERO_ERROR;
	UBreakIterator *bi = ubrk_open(UBRK_CHARACTER, lang.ascii().get_data(), (co_data(), utf16.length(), &err);
	if (U_SUCCESS(err)) {
		while (ubrk_next(bi) != UBRK_DONE) {
			int pos = _convert_pos(p_string, utf16, ubrk_current(bi));
			ret.push_back(pos);
		}
		ubrk_close(bi);
	} else {
		for (int i = 0; i <= p_string.size(); i++) {
			ret.push_back(i);
		}
	}
	return ret;
}
bool TextServerAdvanced::_is_valid_identifier(const String &p_string) const {
#ifndef ICU_STATIC_DATA
	if (!icu_data_loaded) {
		WARN_PRINT_ONCE("ICU data is not loaded, Unicode security and spoofing detection disabled.");
		return TextServer::is_valid_identifier(p_string);
	}
#endif
	enum UAX31SequenceStatus {
		SEQ_NOT_STARTED,