I found a copy of the short story online here: readbookonline.net
The larger context makes it clear it's just a general-purpose diminutive nickname.
(Also, Macfarlane's full name is "Wolfe Macfarlane" )
One afternoon, when his day's work was over, Fettes dropped into a popular tavern and found Macfarlane sitting with a stranger. This was a small man, very pale and dark, with coal-black eyes. The cut of his features gave a promise of intellect and refinement which was but feebly realised in his manners, for he proved, upon a nearer acquaintance, coarse, vulgar, and stupid. He exercised, however, a very remarkable control over Macfarlane; issued orders like the Great Bashaw; became inflamed at the least discussion or delay, and commented rudely on the servility with which he was obeyed. This most offensive person took a fancy to Fettes on the spot, plied him with drinks, and honoured him with unusual confidences on his past career. If a tenth part of what he confessed were true, he was a very loathsome rogue; and the lad's vanity was tickled by the attention of so experienced a man.
'I'm a pretty bad fellow myself,' the stranger remarked, 'but Macfarlane is the boy - Toddy Macfarlane I call him. Toddy, order your friend another glass.' Or it might be, 'Toddy, you jump up and shut the door.' 'Toddy hates me,' he said again. 'Oh yes, Toddy, you do!'
'Don't you call me that confounded name,' growled Macfarlane.