I think I finally found the solution : increase the innodb_buffer_pool_size
to 16Go (our server has 32 and I initially had a value of 128Mo).
The slow queries are fast again, trx_rseg_history_len
is close to zero, the server is brething again.
The first reproducer (without the index) is now executing in 2s the first time, and in 0.4s the following times (I guess the InnoDB files are loaded in the buffer pool).
It's quite disapointing though, that MariaDB/InnoDB respecting MVVC has such a high performance impact for a quite standard/default installation...
AnyAnd thanks @ErgestBasha for helping, I felt less alone :-)