Same as withdraw_gas, but directly receives BuiltinCosts, which enables optimizations
by removing the need for repeated internal calls for fetching the table of constants that may
internally happen in calls to withdraw_gas.
Should be used with caution.