### 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")
```
return spawn_path;
}
void MultiplayerSpawner::set_spawn_path(const NodePath &p_path) {
	spawn_path = p_path;
	_update_spawn_node();
}
void MultiplayerSpawner::_track(Node *p_node, const Variant &p_argument, int p_scene_id) {
	ObjectID oid = p_node->get_instance_id();
	if (!tracked_nodes.has(oid)) {
		tracked_nodes[oid] = SpawnInfo(p_argument.duplicate(true), p_scene_id);
		p_node->connect(SceneStringNames::get_singleton()->tree_exiting, callable_mp(this, &MultiplayerSpawner::_node_exit).bind(p_node->get_instance_id()), CONNECT_ONE_SHOT);
		_spawn_notify(p_node->get_instance_id());
	}
}
void MultiplayerSpawner::_spawn_notify(ObjectID p_id) {
	get_multiplayer()->object_configuration_add(ObjectDB::get_instance(p_id), this);
}
void MultiplayerSpawner::_node_exit(ObjectID p_id) {
	Node *node = Object::cast_to<Node>(ObjectDB::get_instance(p_id));
	ERR_FAIL_COND(!node);
	if (tracked_nodes.has(p_id)) {
		tracked_nodes.erase(p_id);
		get_multiplayer()->object_configuration_remove(node, this);
	}
}
int MultiplayerSpawner::find_spawnable_scene_index_from_path(const String &p_scene) const {