People always say "bitcoin has a hard coded, guaranteed limit of 21 million coins".
Not exactly. 21 million cap is guaranteed by math (like most other things in bitcoin). It is a combination of the starting block reward and reward halvings that ensures there will never be any more than 21 million bitcoins created.
However, I think the limit of 21 million is subject to the consensus of the users and miners?
Yes, like every other consensus rule in bitcoin.
So if a consensus is formed to allow more than 21 million Bitcoins to be generated, then it will be so, right?
Yes, a hard fork has to take place to change the block rewards to allow more or less coins to be generated. But it won't happen because there is no valid reason to change the cap.
Actually everything in Bitcoin can be changed, as long as there is the consensus for it.
Yes, but only if there is a valid reason for doing so. You can't just change stuff for no reason.
So, there is actually no mathematical limit to the number of coins.
There IS a mathematical limit as I explained above.
There is also another limit in form of the amount field in transaction outputs which can only be a 64-bit integer.