If there's only two cases why not just set the default to False and change the dict to

pin_data = {
    'pin': pin,
    'pin_confirmed': pin_confirmed,
}