I came across an interesting article on nzz.ch which should be read by all people planning on leaving Switzerland. It explains how to reduce tax on second pillar pension contributions.
It is a very important point but the suggested solution is not universally valid, because not all countries apply split year treatment. In any case, one of the first things to do when planning to move/retire abroad and cash the 2nd (and 3rd) pillar as lump sum payment is definitely check the legislation of your destination country, see what tax to expect and under what conditions (and dates!) you would be subject to it.