### Godot version

4.0.2

### System information

Win10

### Issue description

Assigning a `MultiplayerSpawner.spawn_function` with a `@tool` script causes it to corrupt a `.tscn` file. 

The resulting file will have a line that looks like this:

```
spawn_function = 
```

Which cases the file to fail to load. Removing that line fixes the file.

### Steps to reproduce

```python
@tool
extends MultiplayerSpawner

func _ready():
	spawn_function = spawnerFunction
	
func spawnerFunction():
	pass
```

Create this minimum GDScript, add it to a new `MultiplayerSpawner`, then save that file. You might need to to re-load the engine, modify the scene, and re-save to trigger the bug.

When the scene is saved, you'll see something like the below, which will refuse to load with this error message:
![image](https://user-images.githubusercontent.com/1642297/233248706-f87e35ce-76fd-4002-ad18-654ba197d468.

### Minimal reproduction project

```
[gd_scene load_steps=2 format=3 uid="uid://is84hf1r3l7u"]

[sub_resource type="GDScript" id="GDScript_hbm3l"]
script/source = "@tool
extends MultiplayerSpawner



func _ready():
	spawn_function = spawnerFunction
	

func spawnerFunction():
	pass
"

[node name="BrokenSpawner" type="MultiplayerSpawner"]
spawn_path = NodePath(".")
spawn_function = 
script = SubResource("GDScript_hbm3l")
```
PackedStringArray warnings = Node::get_configuration_warnings();
	if (spawn_path.is_empty() || !has_node(spawn_path)) {
		warnings.push_back(RTR("A valid NodePath must be set in the \"Spawn Path\" property in order for MultiplayerSpawner to be able to spawn Nodes."));
	}
	return warnings;
}
void MultiplayerSpawner::add_spawnable_scene(const String &p_path) {
	SpawnableScene sc;
	sc.path = p_path;
	if (Engine::get_singleton()->is_editor_hint()) {
		ERR_FAIL_COND(!FileAccess::exists(p_path));
	}
	spawnable_scenes.push_back(sc);
#ifdef TOOLS_ENABLED
	if (Engine::get_singleton()->is_editor_hint()) {
		return;
	}
#endif
	Node *node = get_spawn_node();
	if (spawnable_scenes.size() == 1 && node && !node->is_connected("child_entered_tree", callable_mp(this, &MultiplayerSpawner::_node_added))) {
		node->connect("child_entered_tree", callable_mp(this, &MultiplayerSpawner::_node_added));
	}
}
int MultiplayerSpawner::get_spawnable_scene_count() const {