### Godot version

4.1.rc.custom_build. c83f912bc

### System information

Ubuntu 22.04 CI

### Issue description

When executing
```
extends Node
func _process(delta):

	var temp_variable35241 = RichTextLabel.new()
	add_child(temp_variable35241)
	temp_variable35241.set_fit_content(true)
	temp_variable35241.parse_bbcode("3188932498")
	temp_variable35241.queue_free()
```
this code freeze project in CI for at least 60 seconds

### Steps to reproduce

Above

### Minimal reproduction project

N/A
rect.size.y += theme_cache.table_v_separation;
		}
		if (p_click.y >= rect.position.y && p_click.y <= rect.position.y + rect.size.y) {
			if ((!rtl && p_click.x >= rect.position.x) || (rtl && p_click.x <= rect.position.x + rect.size.x)) {
				if (p_meta) {
					int64_t glyph_idx = TS->shaped_text_hit_test_grapheme(rid, p_click.x - rect.position.x);
					if (glyph_idx >= 0) {
						const Glyph *glyphs = TS->shaped_text_get_glyphs(rid);
						char_pos = glyphs[glyph_idx].start;
					}
				} else {
					char_pos = TS->shaped_text_hit_test_position(rid, p_click.x - rect.position.x);
				}
			}
			line_clicked = true;
			text_rect_begin = rtl ? rect.position.x + rect.size.x : rect.position.x;
		}
		
		if (table_hit && (((char_pos + p_frame->lines[p_line].char_offset) >= table_range.x && (char_pos + p_frame->lines[p_line].char_offset) <= table_range.y) || char_pos == -1)) {
			if (r_click_frame != nullptr) {
				*r_click_frame = table_click_frame;
			}
			if (r_click_line != nullptr) {
				*r_click_line = table_click_line;
			}
			if (r_click_item != nullptr) {
				*r_click_item = table_click_item;
			}
			if (r_click_char != nullptr) {
				*r_click_char = table_click_char;