Hey,
here is an example:
Create a class (class is a script):
extends Node
class_name Person
var first_name: String
func _init(first_name_: String):
first_name = first_name_
Now create the static function in another script:
static func get_person(first_name: String) -> Person:
return Person.new(first_name)
This will then print the given name "Bob":
var person: Person = get_person("Bob")
print(person.first_name)