I was trying to be as value neutral as possible. While I have no doubt that your friend is being railroaded there, getting away from empirical fact into opinions and suppositions becomes problematic because opinions and even rational suppositions are difficult to establish in court. I was serious, he needs a better lawyer. You're in a philosophical sweet-spot where if you can keep your friend from saying anything cantankerous or much of anything at-all, it's possible to obtain legal assistance from both sides of the political divide:
*The local chapter of the ACLU would likely have concerns over the violation by law-enforcement of his civil liberties in how this was handled procedurally.
*The NRA would have concern that he was being persecuted for his use of Castle Doctrine rights and the discharge of a firearm in the defense of his home from persons unknown to him. It's not unreasonable to argue further that he was prosecuted more harshly for cause of the discharge of his firearm.
Try both, if you can get either to send a high-powered scary lawyer, you may just be able to bull over the BS of the CC court system. Judges and prosecutors don't like dealing with litigators likely to make a small-town "invisible" case draw attention because they don't like being publicly-humiliated or overturned on appeal in a high-profile case. In either case, your new friends are going to undertake a media strategy but the less information is out there that might need to be refuted later, the better. It'd have been better if you'd called them before his PD "shat the bed" so to speak. If you can't get legal help, then call a reporter or reporters to keep it public. Let them make this a fiasco for the DA.