Efficient and reliable method for the simulation of scanning tunneling images and spectra with local basis sets