Change object animation become cyclic for many objects, use Python
Get fcurve array for object

fc = object.animation_data.action.fcurves


From list find fcurve want repeat (example location X)

locationX = fc.find('location', index=0)


Create modifier type CYCLES and set mode_before and mode_after become REPEAT

modifier = locationX.modifiers.new(type='CYCLES')
modifier.mode_before = 'REPEAT'
modifier.mode_after = 'REPEAT'


One problem, this method cause two repeat loops between original two keyframes, object move 1/2 time and 1/2 distance between keyframes. Need double original distance and time between key frames.