Switch to input method INPUT-METHOD for the current buffer. If some other input method is already active, turn it off first. If INPUT-METHOD is nil, deactivate any current input method.