A copy is only made if an actor walks into a closed door for a set period of time, which is hardly ever.  I'm no expert in C++ but paths (after the change) is a reference to the real paths and when I pop_back() real path will pop.  I can't remember whether that matters or not, but what I do remember is that I could pop without worrying about whether I was messing up the original.