DISCLAIMER: I've tagged this feature request, but I am aware that such feature will probably difficult to implement. But I'll ask anyway since, I'd like to know the opinion of other users on this.
I was motivated to write this by recent Willie Wong's post about problems with Springer encyclopedia of mathematics: Link Rot Notice: Springer EOM.
First let me explain what I mean under a template. (People active at Wikipedia probably know.) In Wikipedia articles the editors often refer to some sites, like google books, IMDB, PlanetMath,... It makes simpler template to write {{IMDb title|0426883}} instead of writing full url. (I've chosen this template as an example.) If IMDB would decide to change the structure of their url's but kept the id's, the only change would be needed in one place - in the template. Perhaps you remember that Google books used links like this: http://print.google.com/books?id=CuTpgZaLahk and later they changed to http://books.google.com/books?id=CuTpgZaLahkC - of course this is not an issue, since the older form still redirect to the more recent one. But I wanted just add the example, that things change.
Another possible advandatage of such system might be that by typing something like {{Wikipedia|Unimodular group}} you would immediately get e.g Unimodular group or Unimodular group at Wikipedia, so this could also take care of how your link is named. (Based on the format specified in the template.)
In case that the answer would be positive, i.e., that such thing is possible to implement here, I can think of many templates/pages which would be useful specifically for mathematics, first of all MSE, meta.MSE and Mathoverflow, but many more like Wikipedia, ProofWiki, PlanetMath, MathWorld, Springer EOM, Wolfram|Alpha, DOI, JSTOR, MathSciNet...
I'm adding links to discussion about similar feature for DOI, since it seems relevant to this question - I learned about them from Asaf's comments.
Just one last comment - someone might object that by doing this we would be pushing MSE more towards Wikipedia-like design. Let me add here a picture from this blog post which mentions that Stack Overflow has elements of wiki in its hybrid design.