To further clarify:
<xfm:bind nodeset="//@xlink:href[starts-with(., '#') = false]"
calculate="concat('#', .)"/>
does not mean that you run this calculation once per each node. It
means that you attach this calculation to be run _EVERY TIME_ the
dependent nodes change.
So you could try something along the lines of
<xfm:bind nodeset="//@xlink:href" calculate="if(starts-with(.,
'#'),.,concat('#', .))"/>
Note: the above probably has errors, I did not have a chance to try it.
-mikko