Identifying homonyms

What are homonyms?
Technically, they’re words that have the same spoken (or signed) forms, and the same written forms (e.g. bat as in the flying mammal, and bat as in a stick). But it’s not as easy to differentiate words as it looks on the surface.
What appear to be homonyms may just be a single word with multiple but related meanings. For example, a line can mean a long marking connecting two points, but also a wire (e.g. telephone line), a sequence of words (e.g. have your lines memorized), and a row of people (otherwise known as a queue). These are different meanings, but are nevertheless extensions of the first meaning.
More importantly, they have the same etymology, or word history. All those senses of line come from the merger of Old English “line” and Old French ligne, both ultimately from the Latin word linea. In contrast, the two different senses of bat, as the mammal and the stick, come from different sources. Bat meaning the mammal is thought to come from Old Norse leðrblaka (leather flapper), while bat meaning stick comes from both Old English batt and Old French batte, from Latin battre (to beat). Two different etymologies, two different words.
But etymologies can be difficult to distinguish too — what appears to be different etymologies can turn out to be the same if you go back far enough. “Bank” as in a river bank is from Old Norse bakki (ridge) while “bank” as in the financial institution comes from Italian banca (bench). However, both bakki and banca ultimately come from the same Proto-Germanic source meaning both river bank and bench. Thus, the two senses of bank are homonyms if we stop at their Old Norse and Italian origins, but the same word if we go back to Proto-Germanic.
Ultimately, homonyms are tricky to identify because words are tricky to identify. Is it one word with two related meanings, or two words written and spoken/signed the same way? Like many distinctions in linguistics, this one is a little artificial.
