My question is how to avoid handshakes with namahram and what to say when they offer handshakes with us.
Reply should not hurt the person nor should she feel ashamed

You can use gloves or a barrier cloth to avoid skin contact

If it’s very difficult to avoid which causes you unbearable distress, you can shake their hands. Please explain to them that you can’t because it’s part of your faith where you cannot touch non related women

Please watch this lecture of mine which is on this topic:

https://youtu.be/sVxD5fmbvKE