Generic Pickle-Aware Super-Class for Mixing Classes with and without __slots__ in Python
A few of trivial points:


getattr(cls, '__slots__', []) would be better as getattr(..., ()) - tuples are immutable so are normally cached by the implementation.
set(slot for slots in all_slots for slot in slots) would be better as {slot for slots in all_slots for slot in slots}
It might be better to do

try:
    statedict = vars(self).copy()
except TypeError:
    statedict = {}