Hamlet is not, by nature, a hard-hearted person. He has been pushed to harden himself in order to find out how deeply lies the evil in the palace following his father's murder, and his father's charge that he avenge Old Hamlet's death.
I sense compassion on Hamlet's part when he kills Polonius by accident. He certainly had no intent to do so. When he discovers that the old man was hiding behind the arras in his mother's chambers—rather than Claudius—he says,
Thou wretched, rash intruding fool, farewell. I took thee for thy better. Take thy fortune. (III, iv, 31-32)
Hamlet also has compassion for Laertes when he is dying and asks Hamlet for his forgiveness, even though Laertes has poisoned him. Laertes identifies Claudius at the root of the evil plan to kill Hamlet, and after Hamlet kills his uncle, he returns to Laertes, who says:
Exchange forgiveness with me noble Hamlet. Mine and my father's death come not upon thee / Nor thine on me! (V, ii, 340-342)
And Hamlet offers his forgiveness,
"Heaven make thee free of it" (I, ii, 343),
even though he knows he is dying by Laertes' act of evil vengeance.