The HM2 is an excellent squirrel round. And ammo is about as much as premium .22 lr ammo.
The 17HMR is great for squirrels as long as you don't want to eat them

. you better make a head shot or there isn't much left. The 17 Vmax and TNT ammo is designed for small varmint hunting, so it maximizes damage to small game.
Hard to go wrong with a good .22 though, especially with all the available ammo for them. But the 17 HM2 uses the same bullet the HMR does, but it's based on a 22 lr stinger case where as the HMR is based on a 22 mag case. Still pretty good inherent accuracy with most marlin or savage guns and a bit better range than a standard 22. And not as much damage as a 17HMR.
If I were to ge a squirrel only gun it would be the HM2.
Paul