The solution is to amend the Constitution to set limits on the president's ability to pardon and commute sentences. At the very least, they should be forbidden from pardoning or commuting the sentences of anyone they know personally or have any substantial involvement with. We do not allow people to serve on juries involving defendants they know or have worked with, nor do we allow judges to preside over trials where there is such a clear conflict of interest. The power to pardon people was intended as a tool to avoid miscarriages of justice, not to engage in them.
I don't think this is quite the right suggestion, in part because it is based on a misconception of the intended purpose of the pardoning power. The power of pardon does not exist to avoid miscarriages of justice (although it can respond to them); it exists to give mercy to the unfortunate. If you look at discussions of the pardoning power in the eighteenth century -- Blackstone, Hamilton, James Wilson, etc. -- you find that it is almost unanimously assumed that the person pardoned is a genuine criminal, rightfully convicted. The desirability of pardon arises due to the fact that the criminal is sometimes unfortunate. That is, the discretionary power to pardon is supposed to extend to cases where justice would genuinely be served by punishing the offender to the full extent of the law. What was recognized is that there needs to be "an easy access to exceptions in favor of unfortunate guilt," in Alexander Hamilton's terms. Too narrow a focus on miscarriage of justice leads to suggestions like Brayton's, in which the concern becomes exclusively to avoid conflict of interests, because the only people are supposed to receive pardon are those who are merely victims of a misfiring of law, and not genuine criminals at all. If, however, we regard a discretionary pardoning power as focused on misfortune -- the criminals who are truly criminals but who are (as Wilson puts it) "unfortunate in a higher degree, than that, in which they are criminal" -- then it becomes problematic to make such a restriction, because it puts some of the potentially unfortunate out of the range of pardon. The pardoning power should (again in Hamilton's words) "should be as little as possible fettered or embarrassed". A more reasonable approach when pardons are seen in this light is to make them subject to review for purposes of official censure. This would allow the power of pardon to be as unfettered as possible; but also give Presidents a reason to think twice about using the pardon for political purposes.