How can I copy vertex groups from one mesh to another in Python?
Writing to vertex groups is fairly straightforward.  The API is documented at https://docs.blender.org/api/2.79/bpy.types.VertexGroup.html#bpy.types.VertexGroup

vg.remove( vertex_index_list )


removes vertices from the group (which is different than having a zero weight).  To set a weight for a vertex:

vg.add( vertex_index_list, weight, operation )


Usually you're using operation = 'REPLACE'.

Getting values from a vertex group is a little stickier.  The vg.weight(idx) call will throw an exception if idx is not in the group.  Checking if a vertex belongs to a vertex group in python has a couple of techniques for working around that (wrap it in a try block, or access the vertex group through the v.groups field on the vertex).

What remains is how you decide what weight to assign to each vertex on the destination and the relationship between the vertices in the two meshes.  

One technique that might be useful is choosing the closest vertex.  The brute force way would be to calculate ( src.data.vertices[i].co - dst_vert.co).length for all the source vertices and use the one with the minimum value (which should give you the closest vertex to the dst_vert).