I know how to pass vectors or floats from c++ to Godot:

Vector3 VoxelHideBlocksResult::_b_get_position() const {
	return position.to_vec3();
}
ClassDB::bind_method(D_METHOD("get_position"), &VoxelHideBlocksResult::_b_get_position);

ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "position"), "", "get_position");

But how would I return an array of Vector3s? Ideally I'd like to return this

std::vector<Vector3>

If I try to simply replace Vector3 with my array I get this error:

./core/method_bind.gen.inc:600:16: error: no member named 'encode' in 'PtrToArg<std::__1::vector<Vector3>>'

I'm not sure if this is the case or not, but you may need to use Godot's Array class instead of the std::vector if you want to expose the array to Godot. That said, that is just what I thought off the top of my head and I haven't exposed an Array before to GDScript, so I'm probably off.

I found a couple places where different arrays are used and exposed in the Godot source, so they might be helpful to look at as a reference for how to expose an array to Godot: gltf_skin.cpp - exposes an Int32 array navigation_mesh.cpp - exposes an Array

You seem to be on the right track, you just have to added the vector's you want to the array and return that, as long as you are using the Variant:VECTOR3 built into the godot engine it should work. I will write something below that should generally be what you are looking for.

 Array VoxelHideBlocksResult::_b_get_position() const {
     Array vectorArray;
    vectorArray.append(position.to_vec3());
     return vectorArray;
  }
  ClassDB::bind_method(D_METHOD("get_position"), &VoxelHideBlocksResult::_b_get_position);
  ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "position"), "", "get_position");

Obviously if you wanted more than just one position added to this you would have to iterate through where ever you are getting the Vector3 values from. Not sure if this position.to_vec3() returns just one Vector3 or multiple, if it does just iterate through what it has.

Array VoxelHideBlocksResult::_b_get_position() const {
    Array vectorArray;
    for(auto  i : position.to_vec3())
    {
           vectorArray.append(i);
    }
          return vectorArray;
     }

Hope this helps.

a year later