You could use the is_equal_approx function to check if the vectors are close while avoiding the floating point precision. I'm not sure how close they would have to be to be considered equal though, nor what the performance impact would be.
Using a solution like @cybereality showed with distance_to
is a good solution for more control over what range of distances are considered equal. You can also get a bit more performance out of it by using distance_squared_to
instead of distance_to
:
if transform.origin.distance_squared_to(Vector3(-0.5, -0.6, -0.1)) < 0.01:
print ("almost the same")