Set/clear Port B10 on a SAMD:
(Edit: Change PORT to PORT_IOBASE for lower cycle count access to pins.)
PORT_IOBASE->Group.OUTSET.reg = 1 << 10; // set bit 10
PORT_IOBASE->Group.OUTCLR.reg = 1 << 10; // clear bit 10
There isn't really any clever way to set the bit to a variable value, other than wrapping the above in if/else statements.
(that's not a horrible it looks. All the structure and union calculations are on constants and happen at compile time.)
Note that the AVR examples you provided set most of the bits in the port to zero, as well setting B0 to 1... You could do that as well.
See also Adafruit customer service forums • View topic - Increasing the speed of execution of the adafruit feather
and Duino-hacks/fastdigitalIO_samd.h at master · WestfW/Duino-hacks · GitHub (which is significantly faster than digitalWrite() while maintaining the pin-mapping features, but not so fast as it might be if link-time-optimization were turned on (and if it worked.))
As a more general-purpose RISC CPU, the ARM does not have special instructions to set and clear pins (the AVR does), so the basic "clear a pin" sequence takes four instructions and 2 registers That means that the "max speed" of the 48MHz SAMD is not as much faster than the max speed of a 16MHz AVR. (it is subject to some optimization if you manipulate multiple bits "nearby" in the code. However, it's quite difficult to figure out exactly how the optimization will go, making the creation of fully deterministic code quite ... annoying. )
PORT->Group.OUTSET.reg = 1<<10;
1bc: 2280 movs r2, #128 ; bit value.
1be: 4b02 ldr r3, [pc, #8] ; load address of IO register.
1c0: 00d2 lsls r2, r2, #3 ; finish adjusting bit value, cause it doesn't fit in MOVS
1c2: 601a str r2, [r3, #0] ; store bit value to IO register.