Use an object as a Driver variable
Using the depsgraph
Since the upgrade to 2.8 the depsgraph is a member of the locals of a driver, as are the variables.  See answer to
How to use different types of data blocks for driver variables?
re setting up a test driver.
As an example, driver is on &quot;Cube&quot;.  The object &quot;Lamp&quot; is in scene, and passed as an evaluated object  to the driver via the depsgraph.  The depsgraph can also be used.

def test(*args, depsgraph=None, **kwargs):
    for arg in args:
        print(arg)
    print(depsgraph)   
    return -1 # a simple val to indicate working

&lt;bpy_struct, Object(&quot;Cube&quot;) at 0x7f62fcbefa08, evaluated&gt;
&lt;bpy_struct, Object(&quot;Lamp&quot;) at 0x7f62fcbf0008, evaluated&gt;
&lt;bpy_struct, Depsgraph at 0x7f62faba6c08&gt;

An example to return minimum global z of all other objects in the depsgraph.  The method of @lemon can be used for the object names. Other options could be tagging them via custom property or name prefix suffix.
def test(self, *args, depsgraph=None, **kwargs):

    z = min(o.matrix_world.translation.z for o in depsgraph.objects
    if o != self)

    return z  

Pointerproperties.
IMO the best way to associate an object(s) with another is via a pointer property
bpy.types.Object.driver_obj1 = bpy.props.PointerProperty(type=bpy.types.Object)

which can be assigned via script or UI.
context.object.driver_object1 = context.scene.objects.get(&quot;Lamp&quot;)