Changing object origin to arbitrary point without origin_set()?
you could do something like this in Edit mode.

obj.data.transform(mathutils.Matrix.Translation(-new_origin))
obj.location += new_origin


I use it in this addon which sets the origin to the selected vertex, or median.



or as CoDEmanX points out

obj.data.transform(mathutils.Matrix.Translation(-new_origin))
obj.matrix_world.translation += new_origin