Indeed. It's not necessary to be religious to get to a blissful eternity. I've often said that I think there'll be a place for the goodly unGodly in Heaven. Maybe not at the high table, but a place, nonetheless.
The Pope, as God's Vicar on earth, would be guided in his infallible utterances by a power greater than we can imagine.