### Godot version

4.1 

### System information

Win 10

### Issue description

![image](https://github.com/godotengine/godot/assets/3350340/fb4d82dc-0301-46d4-85e8-032c32b09fcf)

When causing _"output oveflow"_ by printing a lot of text, formating breaks. Possible because enclosing tag get flushed.

Suggested solution: clear text formating after _output oveflow_ warning.

### Steps to reproduce

Print a lot of text with different text tags (like [color] or [bgcolor]) to console. For example in _process function.

### Minimal reproduction project

N/A
for (int i = sr; i < fi; i++) {
			total_height = _resize_line(main, i, theme_cache.normal_font, theme_cache.normal_font_size, text_rect.get_size().width - scroll_w, total_height);
			total_height = _update_scroll_exceeds(total_height, ctrl_height, text_rect.get_size().width, i, old_scroll, text_rect.size.height);
			main->first_resized_line.store(i);
			if (stop_thread.load()) {
				return;
			}
		}
	}
	total_height = (fi == 0) ? 0 : _calculate_line_vertical_offset(main->lines[fi - 1]);
	for (int i = fi; i < (int)main->lines.size(); i++) {
		total_height = _shape_line(main, i, theme_cache.normal_font, theme_cache.normal_font_size, text_rect.get_size().width - scroll_w, total_height, &total_chars);
		total_height = _update_scroll_exceeds(total_height, ctrl_height, text_rect.get_size().width, i, old_scroll, text_rect.size.height);
		main->first_invalid_line.store(i);
		main->first_resized_line.store(i);
		main->first_invalid_font_line.store(i);
		if (stop_thread.load()) {
			return;
		}
		loaded.store(double(i) / double(main->lines.size()));
	}
	main->first_invalid_line.store(main->lines.size());
	main->first_resized_line.store(main->lines.size());
	main->first_invalid_font_line.store(main->lines.size());
	if (fit_content) {
		update_minimum_size();
	}
	emit_signal(SNAME("finished"));
}
void RichTextLabel::_invalidate_current_line(ItemFrame *p_frame) {