The function that makes the URL for questions is qa_q_request (in qa-base.php). You can make a function override that just returns the $questionid
I'm not sure exactly what you mean with regards to the sitemap but the above will change the URL everywhere including on the site itself. It wouldn't make sense to change it only for the sitemap because those URLs will just redirect to the full URLs on the site.
SEO-wise, it will be slightly worse because having keywords in the URL is a ranking factor, though it may be only a small one.