So this question covers string instruments with tuning pegs (eg. guitars, bass guitars, mandolins, ukuleles, etc). When you are installing a new string and you pull it tight for the first time, you then decide on the "extra" amount of string to use. By extra I mean the point of the string you then slide down to meet the machine head, crimp/bend and then begin to wind your string around the peg.
What is the process for determining the optimum amount of string length ? What are the ramifications of using too little string or too much ? Can an exact measure be decided based on the string material, gauge, target note, the distance between nut and bridge, etc ?