Could we please have the same function for an itemlink as well, if this is possible (not sure how exactly these int64 values are build internally, so maybe you really need the bag and slotIndex in there?).

This doesn't make sense, when you look at what a Unique ID is. The Unique ID is unique even between items of the same type. So stay you have two stages that are the same and have the same item link, they will still have different Unique IDs. So it doesn't make sense to be able to get it from an item link.

Ok, I thought the itemLink contains all information about quality, level, enchantment, etc. which builds the unique item ID for an item.
Didn't know the itemLink is the same for these different items but maybe the itemLink only relies on the "itemId" then which isn't unique?

The item link does contain the stuff you listed, but that's not enough to make it unique. I could make two pieces of identical gear and slap on identical glyphs and their links would be the same. Their UIDs would be different, though.