Yeah, that would work. The only improvement I can think of without making it too complex would be to assign the variables one at a time and check each condition as soon as possible.
Like instead of
for a in (0,1):
for b in (0,1):
for c in (0,1):
if (a or b) and (b or not c):
return (a,b,c)
you could do
for a in (0,1):
for b in (0,1):
if (a or b):
for c in (0,1):
if (b or not c):
return (a,b,c)