Does a Catholic have recourse if a priest gives a ridiculously harsh or impossible penance? Say that a person went to confession and confessed a sin, and the priest gives a ridiculously harsh penance (e.g. row across the Atlantic Ocean), or even an impossible penance (fly to the moon). 

If the priest refuses to change that penance, does the penitent has any sort of recourse? Can they, for instance, get a second opinion from another priest? Are they permitted to report to a higher up, such as a Bishop?
Does a Catholic have some recourse if a priest gives a ridiculously harsh or impossible penance?
Well, the short answer is yes.
What recourses one has as a Catholic in the confessional when one receives an arbitrary ridiculous harsh or unpractical (undoable) penance, let us take a look at the sacrament of reconciliation more closely.
Priests are obliged to hand out penances during the sacrament of confession. This point is not open to debate.
If one receives an extremely harsh or undoable penance, one should approach the priest in question and ask for a doable, yet reasonable penance.
One can always go to another confessor and explain the situation get guidance about what to do.
And yes you are always free to report the matter to a priest's superior, either the local bishop or in the case of a religious priest, their immediate religious superior. This should be done in cases where the priest imposes something like you must fly to the moon. Bishops should be notified about priests that are sloppy about the sacrament of confession.
There is an obligation in can. 981 to impose penances during confession.  Can. 981 is a legal and not just instructional type of canon.  It places an obligation on the confessor and the penitent:

Can.  981 The confessor is to impose salutary and suitable penances in accord with the quality and number of sins, taking into account the condition of the penitent. The penitent is obliged to fulfill these personally.

Fr. John Zuhlsdorf puts it nicely:

In other words, penances are to be given, and the penitent is to do them, not some one else. You cannot pay another person to do them.  But this obligation to give and do penances does not affect the validity of the absolution or the efficacy of the sacrament. If the penitent hasn’t done the assigned penance before going to Communion, he is still forgiven and can still go to Communion.
And, yes, it is a bit arbitrary to assign penances. How do we really judge that 3 Hail Marys are proportioned to, say, serial adultery. But how would 10 Rosaries be proportioned?
In any event, the penances assigned in confession do not affect the efficacy of the sacramental absolution we receive.
Confession can be hard, but it shouldn’t be the rack.
Priests should take it easy on people and not assign penances that are vague or hard to do. They should make clear to people what the requirements are for the sacrament of penance to be efficacious, so that they are not left in doubt or, by falling into error, run the risk of becoming discouraged or overly scrupulous. - Am I forgiven if I don’t do a penance assigned in confession?

Penances should be very clear, not vague or undoable.

And remember, validity of absolution is not contingent on the penance that is assigned.  Yes, we penitents must do our best to do some penance and we have a strong motivation to take the penance that the priest assigns seriously.  But sometimes these well-meaning nitwits suggest something incomprehensible or undoable.  So, we get out of the box, scratch our heads, and do something else that’s meaningful.  Or, if there is time and opportunity, go to a different confessor, explain the situation, and get guidance about what to do.  Not everyone has that option. - Penance given in confession was too vague

Note that a penitent has a moral obligation to report the priest to religious and/or civil authorities if the penance is illegal and/or immoral. If a priest were ever to solicit sex in the confessional, this crime should be reported to religious authorities as soon as possible. (Although not directly in Canon Law, this is still a moral issue not to be taken lightly):
Sex abuse and the seal of the confessional

The 1917 Code of Canon Law continued Benedict XIV’s 1741 decree, and required the penitent to denounce the soliciting priest within one month. The 1983 Code abolished the requirement to denounce and the reservation of absolution to the pope for false accusations against priests. Instead, it imposed an automatic interdict, a form of excommunication, on anyone making a false accusation. Canon 982 further provides that anyone who confesses to making a false accusation “is not to be absolved unless the person has first formally retracted the false denunciation, and is prepared to repair damages if there are any.”

The Code of Canon Law (1983) does not forbid the denunciation of such acts. It warns us more about false accusations instead than denouncing bad priests. We are still free to speak the truth if a priest were to solicit evil in the confessional. The Code of Canon Law (1917) is much clearer and harsher on the subject. The 1917 Code of Canon Law &quot;required the penitent to denounce the soliciting priest within one month&quot;. We are no longer required to denounced within a month, but this should nevertheless still be done, as soon as possible. I know I would!
The Supreme Sacred Congregation of the Holy Office (1962) speaks of how such denunciations are to be done in its' Instruction On the Manner of Proceeding in Causes involving the Crime of Solicitation.
Let us not forget to pray for the sanctification of our priests. May they imitate St. John Vianney (Cure d'Ars), the universal patron saint of parish priests.

St. John Marie Vianney would pass uncomfortable nights shaken by the “grappin” (Devil) –  happily because he knew it was a good sign that the next day some big sinner would come to the Sacrament of Confession.  Sometimes there would be a “good haul of fish,” as he called the many sinners who would show up to confess after the Cure had passed such a night.
He would rise in the middle of the night to begin hearing confessions at one o’clock in the morning, and spend an incredible 14 to 18 hours a day in the confessional.
If a penitent withheld certain sins, the Cure would admonish them and proceed, to their astonishment, tell them their sins. He was known to weep while hearing confessions, with the remark, “I weep, my friend, because you do not weep.” - The Story of the Cure of Ars