### 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")
```
clear_spawnable_scenes();
	for (int i = 0; i < p_scenes.size(); i++) {
		add_spawnable_scene(p_scenes[i]);
	}
}
void MultiplayerSpawner::_bind_methods() {
	ClassDB::bind_method(D_METHOD("add_spawnable_scene", "path"), &MultiplayerSpawner::add_spawnable_scene);
	ClassDB::bind_method(D_METHOD("get_spawnable_scene_count"), &MultiplayerSpawner::get_spawnable_scene_count);
	ClassDB::bind_method(D_METHOD("get_spawnable_scene", "index"), &MultiplayerSpawner::get_spawnable_scene);
	ClassDB::bind_method(D_METHOD("clear_spawnable_scenes"), &MultiplayerSpawner::clear_spawnable_scenes);
	ClassDB::bind_method(D_METHOD("_get_spawnable_scenes"), &MultiplayerSpawner::_get_spawnable_scenes);
	ClassDB::bind_method(D_METHOD("_set_spawnable_scenes", "scenes"), &MultiplayerSpawner::_set_spawnable_scenes);
	ADD_PROPERTY(PropertyInfo(Variant::PACKED_STRING_ARRAY, "_spawnable_scenes", PROPERTY_HINT_NONE, "", (PROPERTY_USAGE_STORAGE | PROPERTY_USAGE_INTERNAL)), "_set_spawnable_scenes", "_get_spawnable_scenes");
	ClassDB::bind_method(D_METHOD("spawn", "data"), &MultiplayerSpawner::spawn, DEFVAL(Variant()));
	ClassDB::bind_method(D_METHOD("get_spawn_path"), &MultiplayerSpawner::get_spawn_path);
	ClassDB::bind_method(D_METHOD("set_spawn_path", "path"), &MultiplayerSpawner::set_spawn_path);
	ADD_PROPERTY(PropertyInfo(Variant::NODE_PATH, "spawn_path", PROPERTY_HINT_NONE, ""), "set_spawn_path", "get_spawn_path");
	ClassDB::bind_method(D_METHOD("get_spawn_limit"), &MultiplayerSpawner::get_spawn_limit);
	ClassDB::bind_method(D_METHOD("set_spawn_limit", "limit"), &MultiplayerSpawner::set_spawn_limit);
	ADD_PROPERTY(PropertyInfo(Variant::INT, "spawn_limit", PROPERTY_HINT_RANGE, "0,1024,1,or_greater"), "set_spawn_limit", "get_spawn_limit");
	ClassDB::bind_method(D_METHOD("get_spawn_function"), &MultiplayerSpawner::get_spawn_function);
	ClassDB::bind_method(D_METHOD("set_spawn_function", "spawn_function"), &MultiplayerSpawner::set_spawn_function);
	ADD_PROPERTY(PropertyInfo(Variant::CALLABLE, "spawn_function", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR), "set_spawn_function", "get_spawn_function");
	ADD_SIGNAL(MethodInfo("despawned", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
	ADD_SIGNAL(MethodInfo("spawned", PropertyInfo(Variant::OBJECT, "node", PROPERTY_HINT_RESOURCE_TYPE, "Node")));
}
void MultiplayerSpawner::_update_spawn_node() {