There's some products that you spray and it's supposed to give them a nasty headache and then they learn and stop coming. It gave me headaches as well though.
Contrary to what the internets want you to believe, there are bird murder machines called "cats", which seems to skip most of the "learning" and the "headache" part.