Consistent triangulation when exporting shape keys
You could add a Triangulate Modifier, with either Fixed or Fixed Alternate as the Quad Method. Make sure to Apply modifier in the .obj exporter with:

for obj in bpy.context.selected_objects:
    if not 'Triangulate' in obj.modifiers:
        tri_mod = obj.modifiers.new(name='Triangulate', type = 'TRIANGULATE')
        tri_mod.quad_method = 'FIXED'

bpy.ops.export_scene.obj(
    filepath = temp.name,
    use_selection = True,
    use_edges = False,
    use_normals = True,
    use_uvs = True,
    use_materials = False,
    use_triangles = True,
    keep_vertex_order = True
    use_mesh_modifiers = True)