Use unsafe code with `MaybeUninit` to generate a builder that doesn't move anything (once we are ready)
This is based on a reddit comment
The proposal is to implement a builder that uses MaybeUninit<Fields> under the hood and does ptr::write/read to access the underlying fields. It does so safely because the builder has the info about which fields are initialized using the type state.
I'm writing up this issue for the future when bon is more stable and feature complete, at which point the cost of maintaining unsafe code isn't that high.
Motivation
This will allow for better-optimized debug builds. The current approach of using the safe code doesn't allow for that because it moves data around and relies on compiler optimizations. With the MaybeUnint version we don't move anything and just mutate an existing memory.
Note on the important caveat that there must be a generic Drop implementation that makes sure all fields that were initialized are dropped in case when only part of the fields were initialized (e.g. there was a panic or an error in the middle).