Well there isn't a ton you can do per se -- I mean, you are effectively just replacing our implementation, right? The only thing I'd recommend is that you return a string as that's what the method is expected to return (and the default version does).
Templater functions are reasonably low level, so it will always be difficult for multiple add-ons to change the same one in compatible ways, especially if you're overriding the main function itself (fnAvatar in this case), given that it's just returning HTML.