### Godot version

v4.0.beta17.official [c40020513]

### System information

Windows 10

### Issue description

GDScript-based `EditorPlugin` addons end up forwarding their input in unexpected ways as different nodes are selected. The plugin's input handling remains active despite `_handles()` no longer returning true. Furthermore, duplicate `EditorPlugin._forward_3d_gui_input()` calls (and similar methods) occur when the bug is triggered, piling up each time it happens, and persisting until Godot is rebooted.

Switching the selection between node types handled by different plugins each seems to trigger this issue consistently, and a minimal reproduction project to accomplish this is provided.

### Steps to reproduce

1. Create a new project.
2. Create 2 `EditorPlugin` GDScript addons, and filter their `_handles()` with different node types.
3. Create a few nodes, 2 of which match the aforementioned `_handles()`.
4. Repeatedly switch the selection on the node tree, and measure their input forwarding (For example, by using `_forward_3d_gui_input()`).

### Minimal reproduction project

[EditorPlugin Input Forwarding Bug.zip](https://github.com/godotengine/godot/files/10613798/EditorPlugin.Input.Forwarding.Bug.zip)

Scroll the mousewheel while having a `Marker3D` or a `Path3D` node selected to debug-print, and then switch to the other one and also scroll the mousewheel. Keep switching selections forth and back to keep triggering the bug.
if (editor_run.get_status() == EditorRun::STATUS_PLAY) {
		play_button->set_pressed(!_playing_edited);
		play_scene_button->set_pressed(_playing_edited);
		return;
	}
	play_button->set_pressed(false);
	play_button->set_icon(gui_base->get_theme_icon(SNAME("MainPlay"), SNAME("EditorIcons")));
	play_scene_button->set_pressed(false);
	play_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayScene"), SNAME("EditorIcons")));
	play_custom_scene_button->set_pressed(false);
	play_custom_scene_button->set_icon(gui_base->get_theme_icon(SNAME("PlayCustom"), SNAME("EditorIcons")));
	String write_movie_file;
	if (write_movie_button->is_pressed()) {
		if (p_current && get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root()->has_meta("movie_file")) {
			
			write_movie_file = get_tree()->get_edited_scene_root()->get_meta("movie_file");
		} else {
			write_movie_file = GLOBAL_GET("editor/movie_writer/movie_file");
		}
		if (write_movie_file == String()) {
			show_accept(TTR("Movie Maker mode is enabled, but no movie file path has been specified.\nA default movie file path can be specified in the project settings under the Editor > Movie Writer category.\nAlternatively, for running single scenes, a `movie_file` string metadata can be added to the root node,\nspecifying the path to a movie file that will be used when recording that scene."), TTR("OK"));
			return;
		}
	}
	String run_filename;
	if ((p_current && p_custom.is_empty()) || (editor_data.get_edited_scene_root() && !p_custom.is_empty() && p_custom == editor_data.get_edited_scene_root()->get_scene_file_path())) {
		Node *scene = editor_data.get_edited_scene_root();
		if (!scene) {
			show_accept(TTR("There is no defined scene to run."), TTR("OK"));
			return;