### 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.
void stop_child_process(OS::ProcessID p_pid);
	Ref<Theme> get_editor_theme() const { return theme; }
	Ref<Script> get_object_custom_type_base(const Object *p_object) const;
	StringName get_object_custom_type_name(const Object *p_object) const;
	Ref<Texture2D> get_object_icon(const Object *p_object, const String &p_fallback = "Object");
	Ref<Texture2D> get_class_icon(const String &p_class, const String &p_fallback = "Object") const;
	bool is_object_of_custom_type(const Object *p_object, const StringName &p_class);
	void show_accept(const String &p_text, const String &p_title);
	void show_save_accept(const String &p_text, const String &p_title);
	void show_warning(const String &p_text, const String &p_title = TTR("Warning!"));
	void _copy_warning(const String &p_str);
	void set_use_startup_benchmark(bool p_use_startup_benchmark, const String &p_startup_benchmark_file);
	Error export_preset(const String &p_preset, const String &p_path, bool p_debug, bool p_pack_only);
	Control *get_gui_base() { return gui_base; }
	Control *get_theme_base() { return gui_base->get_parent_control(); }
	void save_scene_to_path(String p_file, bool p_with_preview = true) {
		if (p_with_preview) {
			_save_scene_with_preview(p_file);
		} else {
			_save_scene(p_file);
		}
	}
	bool is_scene_in_use(const String &p_path);
	void save_layout();
	void open_export_template_manager();
	void reload_scene(const String &p_path);
	void find_all_instances_inheriting_path_in_node(Node *p_root, Node *p_node, const String &p_instance_path, List<Node *> &p_instance_list);
	void reload_instances_with_path_in_edited_scenes(const String &p_path);
	bool is_exiting() const { return exiting; }