### 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
_THREAD_SAFE_METHOD_
	FontAdvanced *fd = memnew(FontAdvanced);
	return font_owner.make_rid(fd);
}
void TextServerAdvanced::_font_set_data(const RID &p_font_rid, const PackedByteArray &p_data) {
	FontAdvanced *fd = font_owner.get_or_null(p_font_rid);
	ERR_FAIL_COND(!fd);
	MutexLock lock(fd->mutex);
	_font_clear_cache(fd);
	fd->data = p_data;
	fd->data_ptr = fd->data.ptr();
	fd->data_size = fd->data.size();
}
void TextServerAdvanced::_font_set_data_ptr(const RID &p_font_rid, const uint8_t *p_data_ptr, int64_t p_data_size) {
	FontAdvanced *fd = font_owner.get_or_null(p_font_rid);
	ERR_FAIL_COND(!fd);
	MutexLock lock(fd->mutex);
	_font_clear_cache(fd);
	fd->data.resize(0);
	fd->data_ptr = p_data_ptr;
	fd->data_size = p_data_size;
}
void TextServerAdvanced::_font_set_face_index(const RID &p_font_rid, int64_t p_face_index) {