It would be wiser not to give chocolate cake to birds. Artificial chocolate flavour may be fine, but if the cake contains real chocolate pieces it could kill them.
Chocolate is, in fact, toxic but we don't normally eat enough for it to affect us. A bar of real chocolate given to a dog could make it ill. That is why dog chocolate drops aren't real chocolate. The amount of chocolate in one M&M or Smarties chocolate bean is enough to kill a small bird.