Carter tried his hardest to not allow the Shah to come to the US for medical treatment. President Nixon probably had a lot to do with convincing Carter to let him come.
Nevertheless, the Shah wasn't allowed to stay in America and probably would have turned him over during the Hostage Crisis.