Or create a struct that holds all anticipated values as pointers. Create setters. Yes the api will be different from the other languages involved but the other languages have generics.
In other words there is a solution to the problem that doesn't require generics at all.