iPhone and other phones use carrier short codes for call control and service functions.
Using those short codes directly can be confusing due to some of the responses shown, yes.
That confusion and concern can be profitable for those folks profiting from website ads and such. There are some incorrect claims around this area, too.
The following examples use T-Mobile short codes.
You can use **21*18885551212# to enable call forwarding (to 1-888-555-1212, or whatever other number you’d prefer) and ##21# to disable it, but using the iPhone Settings > Apps > Phone > Call Forwarding mechanism is an easier path into the same setting.
**61*18885551212# and ##61# for enabling and disabling conditional call forwarding, a feature which is available from T-Mobile and some other carriers.
iPhone doesn’t directly support conditional call forwarding, so you’ll need to use the associated short codes to control that feature.
Both unconditional and conditional call forwarding are discussed by Apple here:
Set up call forwarding on iPhone - Apple Support
The list of short codes for T-Mobile is here:
https://www.t-mobile.com/support/plans-features/self-service-short-codes/
Short codes are less than entirely consistent across different carriers.
These short codes are intended for your use, and don’t represent a hack. You can experiment with unconditional call forwarding here for instance, using the short codes and using Settings to change or view the setting.
If you have concerns about short codes or the security of your carrier services, check with your carrier.