### 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
return visible_characters;
}
int RichTextLabel::get_character_line(int p_char) {
	_validate_line_caches();
	int line_count = 0;
	int to_line = main->first_invalid_line.load();
	for (int i = 0; i < to_line; i++) {
		MutexLock lock(main->lines[i].text_buf->get_mutex());
		if (main->lines[i].char_offset < p_char && p_char <= main->lines[i].char_offset + main->lines[i].char_count) {
			for (int j = 0; j < main->lines[i].text_buf->get_line_count(); j++) {
				Vector2i range = main->lines[i].text_buf->get_line_range(j);
				if (main->lines[i].char_offset + range.x < p_char && p_char <= main->lines[i].char_offset + range.y) {
					return line_count;
				}
				line_count++;
			}
		} else {
			line_count += main->lines[i].text_buf->get_line_count();
		}
	}
	return -1;
}
int RichTextLabel::get_character_paragraph(int p_char) {