Apparently I can't post URLs, but I'd request:
CGenius - A Commander Keen open source engine reimplementation. 2D classic platforms seem to be a good fit for the 3DS.
Solarus - An open source engine for games like Zelda: A Link to the Past. There are some nice Zelda fan games in this engine.
Both of those engines have received ports to the Switch and other hardware, Those ports might be a good starting port where calls are already changed to SDL for input, sound, whatever.
In addition I know there are some who already tried taking the SM64 decomplication project and porting it to the 3DS, but it is really on the edge of being able to run and perform well. The request I'd make is to work with Kaze, who makes SM64 rom hacks. He has made a bunch of engine optimizations of better models that look better but have fewer polygons and massive engine improvements. He has not released his code, but I wonder if he would be willing to share it with people working on the engine.