you meant
x = set()
the function acting on x does not need to return x, it can modify the passed value.
there is no duplication of data when you return a list or any other object... just because the value passed is not copied.
you are affected by the premature optimization syndrome since you are trying to solve an optimization problem before testing that the problem actually holds.
Example of function modifying a set:
>>> def f(x):
... x.add(42)
...
>>> x = set([13])
>>> x
set([13])
>>> f(x)
>>> x
set([42, 13])