What to do if asked to write a letter of recommendation for a weak candidate?
Although it may be quite awkward, it is certainly acceptable to tell the student/colleague that you do not feel you can write a strong LoR for them, and to suggest that they ask someone else. This may seem rude or even unkind, but it's much better for the student/colleague in the long run than a lukewarm or poor letter.