Look, should a CSS snippet copywriteable? What about a complex SQL query?
Imo, no singular LOC is unique in the way that a newly developed drug is unique or a song is unique. If devs can agree on that, why should that extend to an arbitrarily long combination of LOCs?
Even if it's somehow copyrightable, why should the rights of that LOC extend to the person claiming theirs has been breached? It's a bold claim to say that you are the first dev in the world to have ever created a particular piece of functionality.
Code should be treated like trade secrets - the protection of the creator is in the meticulous seperation of end product from recipe. SaaSs already do this, the entire front end is publicly visible code, which line-for-line, rarely accounts for more than a small % of the backend logic.