Yep, as soon as the commit below hits tests-passed, you can do what you are looking to do:
https://github.com/discourse/discourse/commit/f6a3c22a898069e6e15a4e220fc12b91eba2e15e
(It might take an hour or so for that to hit tests-passed.)
So I added new IDs for the share icons in the post and topic buttons, so you can isolate them now in the API replaceIcon call, like this:
api.replaceIcon('d-post-share', 'share-square');
api.replaceIcon('d-topic-share', 'share-square');
