Finding closest distance from point to mesh in BGE
If it's just the distance to the Bound Box, does not require any complex function for this.

I do not usually use bge, but you can take advantage of this code to get the nearest point of a Bound_Box.

#bound.min: smaller coordinates x, y, z of Bound Box
#bound.max: greater coordinates x, y, z of Bound Box
#co coordinate of the point to test the nearest
from math import sqrt
def find_nearest_t_AABB(bound, co):
    nearest = [0.,0.,0.]
    dist = 0.
    for i in range(3):
        if (bounds.min[i] &gt; co[i]):
            nearest[i] = bounds.min[i]
        elif (bounds.max[i] &lt; co[i]):
            nearest[i] = bounds.max[i]
        else:
            nearest[i] = co[i]

        dist += (co[i] - nearest[i])**2
    return sqrt(dist), nearest