It is true that it could be medical. pain associated with a bowel movement may make him resist going into the box.
You may want to try a second box. Just because he used the same box for all these years, doesn't mean that his preferences didn't changed (and some cats don't like to pee and poop in the same box).
Also, could the level of the litter be too low. I have one cat who only poops outside the box if he feels the litter level is not deep enough.
Was he scared while inside the box pooping? and now he fears it happening again?