### 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
List<Item *>::Element *E = p_reverse_search ? table->subitems.back() : table->subitems.front();
				if (_search_table(table, E, p_string, p_reverse_search)) {
					return true;
				}
			} break;
			default:
				break;
		}
	}
	int sp = -1;
	if (p_reverse_search) {
		sp = txt.rfindn(p_string, p_char_idx);
	} else {
		sp = txt.findn(p_string, p_char_idx);
	}
	if (sp != -1) {
		selection.from_frame = p_frame;
		selection.from_line = p_line;
		selection.from_item = _get_item_at_pos(l.from, it_to, sp);
		selection.from_char = sp;
		selection.to_frame = p_frame;
		selection.to_line = p_line;
		selection.to_item = _get_item_at_pos(l.from, it_to, sp + p_string.length());
		selection.to_char = sp + p_string.length();
		selection.active = true;
		return true;
	}
	return false;
}
bool RichTextLabel::search(const String &p_string, bool p_from_selection, bool p_search_previous) {