It seems to me that you're very confused by all this. Let's address some of these myths that you've dragged up.
Casting is slow compared to normal assignments.
That really depends on what you're casting. Between different address types, no; casting is actually free there as you're just applying a different interpretation to the same value. Casting between different widths of numeric type can be a bit slower (and sometimes is done implicitly on assignment) but is still very fast.
Function calls are slow.
Not really. They're not free, but the cost is not high enough that you should avoid them unless you've got profiling data that says otherwise. Never optimize without a very good reason to do so and proof that it will help. (For the record I've been known to revert attempted optimizations that did not have the balance of performance gains I wanted.)
Binary operations are faster than normal operations.
What's a “normal operation”? FWIW, addition is a binary operation. So is multiplication. On modern hardware, they're both pretty fast. Let the compiler worry about that. It's far more important that you focus on describing what you're doing correctly.
Now, for things that really cost:
- I/O.
- Memory allocation.
- Memory copies.
- Deeply nested (or very long) loops.
Keep your eyes on those; they're where software usually gets slow. And always pick good algorithms and data structures.