I've started using TOML for a different application, and I think it's a better fit here than CSV. Starting with Python 3.11, tomllib.load
returns a dictionary with each entry in an appropriate type, i.e., it does the typecasting for you.
As I said in a comment earlier, I'm not sure it's worth porting a bunch of old CSV files to TOML, but if I had to implement this feature from scratch, I would use TOML.