It is as easy as knowing the virtual pin starting address and using the type helpers for bit manipuation
That address varies among Raspberry versions but is documented on the Raspberry Pi website.
<address>.Setbit/togglebit etc. I can post a complete example for it if you want.
Actually, I wrote the helpers with my Raspberry Pie's in mind and it works quite good...
(Note that Avra extended the bit manipulation helpers so you may want to examine his new options too )
(Also note I never tested this for AARCH64 on RP3, but I did for RP4, the code assumes a 32 bit value, I tested it on all 32 bit types since RP1 )