Blender Version
2.79
Short description of error
In rna_Object_ray_cast(), which implements the code for Object.ray_cast(origin, direction, distance) in the bpy API, the direction vector is normalized before the call to BLI_bvhtree_ray_cast().
However, the more efficient bounding box test that is run before that calls isect_ray_aabb_v3_simple() with the original direction vector and it is not normalized in that function: https://developer.blender.org/diffusion/B/browse/master/source/blender/blenlib/intern/math_geom.c;f6367ecfb65502a1ec40c5e382800b2ac214a499$2479
Does it simply not matter whether a unit vector is passed or not, or could this be a bug?