### 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")
```
for (uint32_t i = 0; i < spawnable_scenes.size(); i++) {
		if (spawnable_scenes[i].path == p_scene) {
			return i;
		}
	}
	return INVALID_ID;
}
int MultiplayerSpawner::find_spawnable_scene_index_from_object(const ObjectID &p_id) const {
	const SpawnInfo *info = tracked_nodes.getptr(p_id);
	return info ? info->id : INVALID_ID;
}
const Variant MultiplayerSpawner::get_spawn_argument(const ObjectID &p_id) const {
	const SpawnInfo *info = tracked_nodes.getptr(p_id);
	return info ? info->args : Variant();
}
Node *MultiplayerSpawner::instantiate_scene(int p_id) {
	ERR_FAIL_COND_V_MSG(spawn_limit && spawn_limit <= tracked_nodes.size(), nullptr, "Spawn limit reached!");
	ERR_FAIL_UNSIGNED_INDEX_V((uint32_t)p_id, spawnable_scenes.size(), nullptr);
	SpawnableScene &sc = spawnable_scenes[p_id];
	if (sc.cache.is_null()) {
		sc.cache = ResourceLoader::load(sc.path);
	}
	ERR_FAIL_COND_V_MSG(sc.cache.is_null(), nullptr, "Invalid spawnable scene: " + sc.path);
	return sc.cache->instantiate();
}
Node *MultiplayerSpawner::instantiate_custom(const Variant &p_data) {