I also had this problem for a while, a few years ago. What worked for me was making somewhat of a joke out if it. For example, if she holds her arms out waiting for a hug, hold your hands up (as if you're playing patty cake) and say something like "Oooooooh. Im so so SO very sorry." If she gets it at that point, good...her respect will only increase. If she doesn't, like most women, and asks "Sorry for what?", say with a grin "Im so sorry you can't hug me anymore. This must be very hard for you." And WHAM-her arms go down, she laughs, and you've defused the situation while getting the point across.
-Or, when she holds her arms up for the hug, ask her "What're you gonna hug? My beard?" Unless she's an idiot, she'll put her arms down.
-Or, when she's in hugging position, exclaim "WOW! You've gained so much weight!". She won't know what hit her, and she usually won't have the urge to hug you anymore.
-Or, in the more common situation of her spotting you from the other side of the shuk and running towards you screeching at the top of her lungs "Maalin!!!" and running at you full throttle, simply side step...momentum will take its course and she will find herself in the middle of oncoming traffic. No more hugging.
Will