This is not stripping any cookie, but rather regsubing a lot of uri extensions/parameters (like ver=somethingsomething). Personally I think that if you didn't intentionally write this, then don't use it.
Regarding the question about what impact removing the google __utm* cookies will have on analytics then. You link to some external js script, client fetches it and google issues a Set-Cookie that matches your domain. Next request the user does to YOU contains this Cookie, and thus prevents you from using an user independent cache. Thus, you remove this cookie on YOUR side.
Google analytics is not affected as the google .js you serve is not able to read the headers on server side, but rather on client side, so in other words they have no function for your site. Analytics got their information when the client requested the .js file. You should obviously not issue any cookies with conflicting names as that could potentially cause problems.
I basically use the example on varnish-cache.org:
if (req.http.Cookie) {
set req.http.Cookie = regsuball(req.http.Cookie, "(^|; ) *__utm.=[^;]+;? *", "\1"); # removes all cookies named __utm? (utma, utmb...) - tracking thing
if (req.http.Cookie == "") {
remove req.http.Cookie;
}
}