How to hook 2 points of a Bézier on 2 different object?
That can be something like this:

import bpy

cube1= bpy.data.objects['Cube1']
cube2= bpy.data.objects['Cube2']
bezier = bpy.data.objects['BezierCurve']

hook = bezier.modifiers.new( name = "Hook-" + cube1.name, type = 'HOOK' )
hook.object = cube1
hook.vertex_indices_set( [0, 1, 2] )

hook = bezier.modifiers.new( name = "Hook-" + cube2.name, type = 'HOOK' )
hook.object = cube2
hook.vertex_indices_set( [3, 4, 5] )


The tricky part is you have to indicate each element of the control points you want to hook. So the hook vertex indices are triplets.

I don't think you can hook control point handles individually, but that may depend of the curve type or the control points mode and have not tested all possibilities.