The paste() makes sure if there were any settings already in the plugin then they are preserved.

The unsetenv() is something cxxfunction should already be doing (IMHO). Currently it will add variables to the environment, but not remove them after. So, without the unsetenv() call, if you later ran cxxfunction again, but with all defaults, any CXXFLAGS you had earlier set would get used. This might not matter, or it might give surprising results. (Imagine if your were using PKG_CXXFLAGS to set '-Wall -Werror' for your own code, but later code links to a 3rd party library and refuses to compile with those options.)