I don't have the heart to tell my boyfriend the song I wrote is about an anime character and not him.
That seems kind of odd, from the way you've told it to me.  Why haven't you told your boyfriend?
I was afraid he would be depressed and may commit suicide, and that would break my heart
It's wrong to lie to your partner, even through omission.  If your boyfriend is vulnerable emotionally, you should be honest with him, but always let him know how important he is to you.
I'm thinking I won't say anything.
I think that just being honest is your best way to handle this as lying about it will be more hurtful. You can maybe write another song about your boyfriend next time.