I do love the ternary operator for initializations like this, but this might be easier to read with bool():

preview_only_mode = bool(preview_only)

Unless preview_only is already expected to be a boolean type, of course.