Well you could try to push their buttons and try to embarrass them but that requires some involvement. Idk if saying "I'm not gay so you can now stop doing that" is offensive but it works sometimes; or "that's creepy who does that", "don't you get enough sex or what", "I'm sorry but why have you touched me just right now?", or just step back when they try to touch making them look stupid "no, you are not doing this to me". It's good to tell them to stop and then everytime they touch you point a finger to their hands and remind them - "see you're doing that again".
But if they are good clueless people or old lady relatives then sometimes it works just to cross my arms and mantain a distance. Sometimes when someone attempts to grab my forearm which old ladies do I sometimes grab it back and give persuasively disapproving look "now look what you are doing there, please don't". And with friends, I just take their arms off me with rolling eyes. Or when you meet them and they try to kiss you if you put your arm forward they don't get to do that. There is this subtle physical play when you can try to take initiative and set a trend for yourself.
Well this is prolly not very helpful but works for me. I just try to be playful about it so that not to offend people. And then I do if they don't get it. I try to sound as if it is not my problem but that I think that it is socially unacceptable as such.