structs: Migrate from namedtuple to dataclass

This lets us do some typing for the attributes, and specify the default
values in a much more user-friendly way.

This can be done now since we’re on Python 3.7!
2 jobs for typing in 28 seconds (queued for 3 seconds)
latest
Status Job ID Name Coverage
  Test
passed #16914
run-test

00:00:23

 
  Build
passed #16915
run-build

00:00:04