I was recently tormented by RTB so could I avoid them and come to a private arrangement by licence
You have a selection of approaches outlined above: licensee as you suggest yourself, and caretaker with a specific legal contract. Either way, if your friend of 40 years decides to challenge it, it will be first of all to the RTB, who will no doubt be looking sceptically at anything you have tried to use to sidle past legislation clearly aimed at making you a RTB landlord in this situation. In other words, they will torment you again. The third, so far unexplored option is to register again with the RTB, and make it a regular tenancy situation. At least that way, if your friend packs up after a year as agreed between friends, you are in the clear. If he doesn't pack up as agreed, you are in for a hard time either way, and trying to duck past the RTB will only add to your troubles, not lessen them.
If you trust your friend and want to help him, push ahead, but be aware of the downsides should he feel he has no other option down the road. Stay on the right side of Revenue at the very least.