Lisp is not a functional language. Or, not an obligate-functional language. I.e. you can do functional if you like, but where it becomes a PITA, you can just assign. Because of that, many optimizations possible in obligate-functional languages are not safe. Because of that, you sometimes need to do your own such optimizations, non-functional-wise.
But it is still easier to get fast code than in an obligate-functional language, because in the latter it is indefinitely hard to predict where such optimizations, where permitted, would actually happen; and in some cases they are not allowed anyway. The tradeoff is that in Lisp (as in other imperative languages) you have to do them yourself where you want them. But you can choose to do them only in hot paths, a tiny fraction of your code.
But it is still easier to get fast code than in an obligate-functional language, because in the latter it is indefinitely hard to predict where such optimizations, where permitted, would actually happen; and in some cases they are not allowed anyway. The tradeoff is that in Lisp (as in other imperative languages) you have to do them yourself where you want them. But you can choose to do them only in hot paths, a tiny fraction of your code.