Fixed default size in Inkex get_unique_id() causes infinite loops
The get_unique_id() function randomly generates ids of a fixed size, with a default value of 4. On sufficiently large documents, the number of valid ids runs out and the function becomes stuck in an infinite loop. This can break many extensions.
An alternative strategy that induces little extra overhead would be to use an adaptive size based on the number of existing ids, for example by setting the default size to
size = math.ceil(math.log10(len(ids)))+1
. This would ensure that in the worst case scenario, collisions occur only 10% of the time.