M-Z should not do Compile Buffer if you are editing a whole file; the same for C-M-Z. When you are editing a whole file, it should be somewhat harder to do those things since they are less likely to be what you want.