I was annoyed that it was such a hassle to find surnames and their respective genders. Therefore, after going through a number of publicly-available datasets, I created this repo including the data as well as some code snippets to play around with.
The data may not be completely clean/complete but it should save a significant amount of time if you're using external datasets to find valid names. The dataset also includes the probability of the respective gender label - but take it with a grain of salt.
I am updating the list on the go.