A simple way to quit vim is to use it in a way that is not supported, e.g. when the input is not a terminal:
% echo die | vim
Vim: Warning: Input is not from a terminal
Vim: Error reading input, exiting...
Vim: Finished.
You can improve that passing the -T option, where you see the familiar interface open before vim exits, e.g. echo die | vim -T vt200.