### 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 _version_button_pressed();
	void _update_undo_redo_allowed();
	int _save_external_resources();
	bool _validate_scene_recursive(const String &p_filename, Node *p_node);
	void _save_scene(String p_file, int idx = -1);
	void _save_all_scenes();
	int _next_unsaved_scene(bool p_valid_filename, int p_start = 0);
	void _discard_changes(const String &p_str = String());
	void _inherit_request(String p_file);
	void _instantiate_request(const Vector<String> &p_files);
	void _quick_opened();
	void _quick_run();
	void _open_command_palette();
	void _write_movie_toggled(bool p_enabled);
	void _run(bool p_current = false, const String &p_custom = "");
	void _run_native(const Ref<EditorExportPreset> &p_preset);
	void _reset_play_buttons();
	void _add_to_recent_scenes(const String &p_scene);
	void _update_recent_scenes();
	void _open_recent_scene(int p_idx);
	void _global_menu_scene(const Variant &p_tag);
	void _global_menu_new_window(const Variant &p_tag);
	void _dropped_files(const Vector<String> &p_files);
	void _add_dropped_files_recursive(const Vector<String> &p_files, String to_path);
	void _update_from_settings();
	void _renderer_selected(int);
	void _update_renderer_color();
	void _exit_editor(int p_exit_code);
	virtual void shortcut_input(const Ref<InputEvent> &p_event) override;
	bool has_main_screen() const { return true; }