How about having encode function in smart contract for multi-use?

Hi I have one very simple question. ( actually opinion)

Once we deploy smart contract on chain, we are not able to modify it.

But sometimes, unpredictable things happen.

To deal with any kind of emergency situation, isn't it safe to have encode function ?

For example,

    function encodeFunction(address _callee, bytes calldata _callData, uint256 _value) public returns (bool) {
        (bool success, bytes memory returnData) ={vaule: _value}(_callData);
        require(success, "tx failed");
        return success;

Let's say there is an airdrop of certain token and your smart contract can't withdraw since you didn't expect to get an airdrop beforehand.

But if we have encode function like above, we can deal with any kind of emergency situation.

Why don't we make this kind of encode function for safety purpose?

I have seen this in some applications and do you think there should be modifiers guarding against malicious calling?

yes I agree

there needs to be modifiers such as onlyOnwer to prevent it from malicious calling.

I am just curious about downside of this function.

If it is guarded by modifiers, downside if there is any can be managed.