When I first started songwriting, my ear worm became much worse. It was my own tunes repeating themselves in my mind. It was not because they were catchy, I think, but because I needed to play them over and over to write them, not to forget them, and to learn to play them fluently. Now, there is usually a song in my head at any given moment, but it doesn't bother me as much.
I was the unmusical one in my family. My mom plays and taught piano for years. My sister became a professional musician, my dad was obsessed by music. My brother probably has a similar amount of musicality as I do, but he did a little more when younger than I did.
So because of this dynamic, I probably spent less time with music than I would have, if I had been the "musical one." Families assign roles, and I was supposed to be the smart kid, a role I took over once I got to college. So despite the fact that I took some piano, played clarinet in junior high band, and sang in the choir, and was pretty much obsessed with music, I got to be defined as unmusical. Now I play piano or keyboard every day when not traveling. I've played drums too, but I need the keys to write the songs.
You can think of analogies. You turn the faucet on, and the water pours out. Or, a clock is broken, and you take it apart to fix it. You look at what is wrong and how it works, and figure out how to make it work again. Both could be metaphors for writing, but the implications are much different. Writing a song could be improvising a melody on the keyboard, or taking apart a song that's not working and fixing its inner dials. The same for a scholarly article.