To negate a boolean, you can use the not operator:
not bool
Or in your case, the if/return blocks can be replaced by:
return not bool
Be sure to note the operator precedence rules, and the negated is and in operators: a is not b and a not in b.