Dealing with options in a program along all the script

How do professional programmers deal with preferences for their application?
I explain:
when there are options to be chosen in an application, does the program is full of “if” to detect what option has been chosen?
Let’s say that there is a call to 30 functions in the program.
But the user has got to choose between an option A or B that would modify the way those 30 functions work.

Would you have to write 60 functions and then place an “if” condition each time to go to the needed one…

Or would it be possible to write at run time (after the program has read the preferences) the corresponding functions? So that it wouldn’t be necessary to check conditions each time?
The goal being to gain total speed in critical functions preventing their run to be slowed down by condition requests.

I’m not sure that all this will be very clear to you, I had difficulties to explain it myself…so please be indulgent;-)