Should my math teacher talk about my grades in his letter of recommendation?
Your advisor might be limited by local law about what s/he may say about your grades. But they can probably say that your grades don't completely reflect your abilities and then comment on those abilities. But, IMO, a too-detailed letter won't serve you as well as one that is more general and speaks about your abilities. If they focus on the positive then it should serve you better, I think. 

However, if you have difficulty in exams you should find a way to work on that. Perhaps it is just ineffective studying. Cramming is a poor way to learn, if that is it. Taking and reviewing better notes throughout the course is a much better way to learn.