### 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.
static void add_build_callback(EditorBuildCallback p_callback);
	static bool immediate_confirmation_dialog(const String &p_text, const String &p_ok_text = TTR("Ok"), const String &p_cancel_text = TTR("Cancel"));
	static void cleanup();
	EditorPlugin *get_editor_plugin_screen() { return editor_plugin_screen; }
	EditorPluginList *get_editor_plugins_force_input_forwarding() { return editor_plugins_force_input_forwarding; }
	EditorPluginList *get_editor_plugins_force_over() { return editor_plugins_force_over; }
	EditorPluginList *get_editor_plugins_over() { return editor_plugins_over; }
	EditorSelection *get_editor_selection() { return editor_selection; }
	EditorSelectionHistory *get_editor_selection_history() { return &editor_history; }
	ProjectSettingsEditor *get_project_settings() { return project_settings_editor; }
	void new_inherited_scene() { _menu_option_confirm(FILE_NEW_INHERITED_SCENE, false); }
	void set_docks_visible(bool p_show);
	bool get_docks_visible() const;
	void set_distraction_free_mode(bool p_enter);
	bool is_distraction_free_mode_enabled() const;
	void add_control_to_dock(DockSlot p_slot, Control *p_control);
	void remove_control_from_dock(Control *p_control);
	void set_addon_plugin_enabled(const String &p_addon, bool p_enabled, bool p_config_changed = false);
	bool is_addon_plugin_enabled(const String &p_addon) const;
	void set_movie_maker_enabled(bool p_enabled);
	bool is_movie_maker_enabled() const;
	void edit_node(Node *p_node);
	void edit_resource(const Ref<Resource> &p_resource);
	void save_resource_in_path(const Ref<Resource> &p_resource, const String &p_path);
	void save_resource(const Ref<Resource> &p_resource);
	void save_resource_as(const Ref<Resource> &p_resource, const String &p_at_path = String());
	void show_about() { _menu_option_confirm(HELP_ABOUT, false); }