Here is what you need to do to get into bootloader, switch back to _a and reflash stock rom.
1. Download loader.img kindly provided by @Willy33 - loader.img
This file was can be generated using adb and working phone like this:
dd if=/dev/block/mmcblk0 of=/sdcard/loader.img bs=1024 count=168960
adb pull /sdcard/loader.img
count=168960 can be larger but this one worked and we don't need 64GB for what we are doing here. it should give you ~185MB loader.img file.
2. Flash loader.img to micro SD card using this command:
sudo dd if=loader.img of=/dev/sdc bs=1024
It doesn't have to be /dev/sdc in your case. it can be sdb, sdd, sde,...
Class 4 SD didn't work for me, this procedure worked after i tried Sandisk Ultra 64GB Class 10, A1, MicroSDXC, U1.... card. Just use class 10 SD card. @Willy33 tried 64GB SD card too and it worked for him.
3. Insert SD card in your phone.
4. Hold Volume down and Power button until bootloader appears
The thing you see now is booted from SD card. Theoretically if you make 64GB loader.img you should be able to boot the whole system from SD card. Can be useful if your emmc dies and yous have fast enough SD card or you want to use i don't know 512GB sd card as internal card.
Don't try to flash anything yet or fastboot --set-active=a, it won't work.
If you run fastboot getvar all you should see if _a or _b is active.
5. Download gpt.bin
I'm not sure this is all the same for all models, use the one from stock ROM for your model if you can to be sure you don't modify partition table or something.
6. Flash gpt.bin:
fastboot flash partition gpt.bin
This will set _a as active back again.
7. Pull the SD card out of your phone.
8. Hold Volume down and Power button until your phone reboots and bootloader show up.
If it does you're done. fastboot getvar all should give you _a as active and you can reflash stock ROM if you want to.
This procedure should work for other moto models. Maybe they can all boot from SD.
Good luck and big thanks to all the people who helped me like @Willy33, @erfanoabdi and @vache.