I've just built something that needed a "Country" specified and I used a datalist for suggestions on the front end and, when posted to the backend, multibyte lower cased it and tried to match it against a stored similar list (based on the ISO list) to generate the stored "country code". Allowed people to enter what they would like (and the list could have "England"->"GB", "Scotland"->"GB" and multiple language "英国"->"CN" ) and made a best effort match. Having the datalist suggestions contain all possible permutations would be difficult though and sometimes users need guidance what they are expected to type...
But, as you brought up, it's "why" you need the country which can be the issue. Delivery/current location is usually the use case, but (as your brought up) asking where someone was born when borders change can be an issue - an Estonian born in 1944 could be presented with "Germany", "Soviet Union", or "Estonia" and all could be technically correct and all be offensive to them at the same time. Grrr...