### 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 _open_imported();
	void _save_default_environment();
	void _update_update_spinner();
	void _resources_changed(const Vector<String> &p_resources);
	void _scan_external_changes();
	void _reload_modified_scenes();
	void _reload_project_settings();
	void _resave_scenes(String p_str);
	void _feature_profile_changed();
	bool _is_class_editor_disabled_by_feature_profile(const StringName &p_class);
	Ref<ImageTexture> _load_custom_class_icon(const String &p_path) const;
	void _pick_main_scene_custom_action(const String &p_custom_action_name);
	void _immediate_dialog_confirmed();
	void _select_default_main_screen_plugin();
	void _bottom_panel_switch(bool p_enable, int p_idx);
	void _bottom_panel_raise_toggled(bool);
	void _begin_first_scan();
	bool use_startup_benchmark = false;
	String startup_benchmark_file;
protected:
	friend class FileSystemDock;
	static void _bind_methods();
	void _notification(int p_what);
	int get_current_tab();
	void set_current_tab(int p_tab);
public:
	
	void _on_plugin_ready(Object *p_script, const String &p_activate_name);
	void editor_select(int p_which);
	void set_visible_editor(EditorTable p_table) { editor_select(p_table); }