The following will return the registration url:
<?php
echo site_url("https://stackoverflow.com/wp-login.php?action=register");
?>
UPDATE:
To get the registration url with a redirect to the current page use:
<?php
echo site_url('/wp-login.php?action=register&redirect_to=' . get_permalink());
?>