### Godot version

4.0.2.stable.official.7a0977ce2

### System information

Linux

### Issue description

The following code fails with godot-cpp
```c++
Variant variant_int = 1234;
double double_value = variant_int;
UtilityFunctions::print(double_value); // prints 0. it must be 1234

Variant double_variant = 6789.0;
int int_value = double_variant;
UtilityFunctions::print(int_value); // prints 0. it must be 1234

Variant variant_string = "12345";
StringName string_name = variant_string;
UtilityFunctions::print(string_name); // Segmentation Fault!
```

When godot-cpp converts a `Variant` to another type, it calls `type_from_variant_constructor` without checking its type. It only does  `reinterpret_cast` and does no type conversion.
I think this issue can be solved by implementing type conversion on the godot-cpp side or by making `type_from_variant_constructor` do the type conversion.

### Steps to reproduce

Unzip the minimal reproduction project and run `scons` to build the GDExtension.

### Minimal reproduction project

[variant-conversion-issue.zip](https://github.com/godotengine/godot/files/11171860/variant-conversion-issue.zip)

static _FORCE_INLINE_ void set(Variant *v, const Color &p_value) { *VariantInternal::get_color(v) = p_value; }
};
template <>
struct VariantInternalAccessor<StringName> {
	static _FORCE_INLINE_ const StringName &get(const Variant *v) { return *VariantInternal::get_string_name(v); }
	static _FORCE_INLINE_ void set(Variant *v, const StringName &p_value) { *VariantInternal::get_string_name(v) = p_value; }
};
template <>
struct VariantInternalAccessor<NodePath> {
	static _FORCE_INLINE_ const NodePath &get(const Variant *v) { return *VariantInternal::get_node_path(v); }
	static _FORCE_INLINE_ void set(Variant *v, const NodePath &p_value) { *VariantInternal::get_node_path(v) = p_value; }
};
template <>
struct VariantInternalAccessor<::RID> {
	static _FORCE_INLINE_ const ::RID &get(const Variant *v) { return *VariantInternal::get_rid(v); }
	static _FORCE_INLINE_ void set(Variant *v, const ::RID &p_value) { *VariantInternal::get_rid(v) = p_value; }
};
template <>
struct VariantInternalAccessor<Callable> {
	static _FORCE_INLINE_ const Callable &get(const Variant *v) { return *VariantInternal::get_callable(v); }
	static _FORCE_INLINE_ void set(Variant *v, const Callable &p_value) { *VariantInternal::get_callable(v) = p_value; }
};
template <>
struct VariantInternalAccessor<Signal> {
	static _FORCE_INLINE_ const Signal &get(const Variant *v) { return *VariantInternal::get_signal(v); }
	static _FORCE_INLINE_ void set(Variant *v, const Signal &p_value) { *VariantInternal::get_signal(v) = p_value; }
};
template <>
struct VariantInternalAccessor<Dictionary> {
	static _FORCE_INLINE_ const Dictionary &get(const Variant *v) { return *VariantInternal::get_dictionary(v); }