import dill


def serialize_obj(obj):
    """Serialize an object without following any dependencies."""
    func_str = dill.dumps(
        obj, protocol=dill.HIGHEST_PROTOCOL, byref=False, recurse=True)
    return func_str