### 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")
```
if (p_name == "_spawnable_scene_count") {
		r_ret = spawnable_scenes.size();
		return true;
	} else {
		String ns = p_name;
		if (ns.begins_with("scenes/")) {
			uint32_t index = ns.get_slicec('/', 1).to_int();
			ERR_FAIL_UNSIGNED_INDEX_V(index, spawnable_scenes.size(), false);
			r_ret = spawnable_scenes[index].path;
			return true;
		}
	}
	return false;
}
void MultiplayerSpawner::_get_property_list(List<PropertyInfo> *p_list) const {