The best thing you can do in this situation (I was in it before!) is to:
Focus on your research experience -- any of it and all of it. Bonus points if the field of that research is the same as the one you are applying to. Focus on this extensively in your SOP. Speak with your former colleagues about that research; was there anything publishable in there? That is a huge help, although by no means is it expected for applicants at this level.
Get into contact with all prospective supervisors well before you apply. Read a lot about their work (or read enough that it seems like you know a lot). If they're willing to talk to you, ask them questions. You could even arrange to visit their lab, if they have the time (I wouldn't frame this as "can I come visit" and more as "I'm going to be in city x in the near future, and I was wondering if I may meet with you and ask you some questions, if you have the time"). The point of this, besides just familiarising you with the nature of the PhD, is to get your name stuck in their minds. You will come across as enthusiastic, interested, and competent. And when applications come around, and they're looking at those piles of papers and deciding which one of those piles looks the nicest, or whether they want any of those piles at all, you will have an advantage. It may or may not be enough to make up for a bad record, but it's better than nothing!
Get some good letters of recommendation, from your research colleagues as you said. Remember, a neutral letter of recommendation is harmful, so choose your referee wisely. When you do this, provide them with a summary of the PhD work so they can write you a letter highlighting the skills you have demonstrated in their lab which are important or helpful for the specific PhD for which you are applying.
If you have trouble with exams but you're otherwise good, you sound a lot like me when I was an undergrad. I'm outrageously dyslexic and I got a serious case of tunnel vision / panic attacks in exams. What I lacked there, I made up with research during every summer of my degree. So a 'meh' academic record is not a death sentence. It just means that it would be smart for you to cast a wide net, and don't over-invest in any one application. You may be disappointed if you shoot for the highest prestige, and you should prepare for that (as should anybody who applies to them) --
I think in your situation, a person who is bad at exams but good at science would be an easier 'sell' for an experimental PhD, if your field and research interests allow this.
And finally, whether to address your 'shortcomings' in a SOP is debatable. For my applications in the UK, I was encouraged to mention a struggle with depression and a close death in the family in order to explain my okay-but-not-great average. For my application in France, I was told to absolutely never do this. I suppose this is probably a function of culture. You should ask people in countries x y and z what they think about this.