When I was into showing and and breeding Shelties, we always removed rear dewclaws (not all pups are born with them, in that breed, anyway). Removal of front dewclaws was a breeder's preference.
As to the question if it hurts. Well, sure it does. They should be removed by 3 days of age and it is relatively easy unless they are large dewclaws.
As many of us assisted in the whelping process, we found it was easy to remove them at birth once established the pup was stable. In most cases, just took a pinch with some hemostats, a clip of the skin with scissors and some Quck stop, if needed. Very quick, very little stress on the pup or the mom.
Actually, it was often an indication to us if we saw other Shelties (of questionable breeding) or got those in rescue with rear dewclaws. Usually a good indication of poor or uneducated breeding practices.
Given my druthers, wish the Greys had they all removed also if they serve no usefull purpose. JMHO