You would have to proxy the request for the script through your own server. For example:
<script src="stripreferrer.php?url=http%3A%2F%2Fthirdparty.com%2Ftest.js"></script>
Then, your server-side code would make the HTTP request sans referrer code, and pass the response to the client.