Zero-padding the FFT is controlled by the pad_to argument.  The NFFT argument controls the size of the sliding window used for psd, csd, and specgram.  This line makes sure that there is at least one window.  It is never invoked with magnitude_spectrum, phase_spectrum, or angle_spectrum, or complex_spectrum, for these NFFT == len(x).