2. Implement it as a custom table access method in an extension.
As an experiment, I have created an extension which forwards all table access functions to the builtin heap access method, but enables the HEAP_INSERT_SKIP_FSM flag for heap_insert and heap_multi_insert. However, the check in heap_getnext (https://github.com/postgres/postgres/blob/REL_12_5/src/backend/access/heap/heapam.c#L1294-L1304) is a showstopper. Because the custom access method uses a different function table (so that I can override heap_insert and heap_multi_insert), heap_getnext errors out with "only heap AM is supported". I am currently hacking around this problem by duplicating all code up to and including heap_getnext, with this check commented out. Clearly this is not ideal, as changes to the heap code in future updates might cause incompatibilities.