In an almost certainly non-canon appearance on Sesame Street back in 1981, C-3PO and R2-D2 sing a song to help Big Bird learn how to count.
In either Legends or Disney canon, has C-3PO ever sung a song?
Yes, in Legends. Specifically, in the novel The Courtship of Princess Leia.
As the name implies, throughout the novel Han is trying to woo Leia, and things are not going well. They end up stranded on an alien planet for complicated reasons, and C-3PO is feeling lost and rather useless, so Han deputizes him to help persuade Leia to love him. C-3PO, for reasons of his own, decides that the first step is to write and perform a theme song for Han.
3PO not only sings (lead and backup, naturally), he also does his own backing band and a dance routine.
"Yes, I've written a song," Threepio said, "and I thought you might appreciate it if I sang it to you." His tone said that he'd be offended if she didn't listen....
A musical intro with horns and strings began playing .... Then he began swirling in dance, doing a softshoe that scraped and echoed over the stone floors, and the droid sang in a deep voice....
He's got his own planet,
although it's kind of wild.
Wookiees love him.
Women love him.
He's got a winning smile!
Though he may seem cool and cocky,
he's more sensitive than he seems,
(Chorus sung in accompaniment with three women who all sound like Leia)
what a man, Solo!
He's every princess's dream!
Threepio ended with a flourish of horns and drums and a tap routine, then took a bow to Leia. Leia just stared at him with an expression somewhere between bewilderment and horror.