You may clamp the inputs with some 5 Volt zeners but that can get spendy. Your opto-coupler approach sounds reasonable. The problem with resistors is that they don't provide spike immunity and the pic may get damaged.