I would love to know how a Solana program's size is calculated.
Do PDA's size that are owned by the program add up when this calculation is done? What about arguments?
A Solana program data account's size is pretty much just the size of the .so file plus 45 bytes for the metadata on the programdata: https://github.com/anza-xyz/agave/blob/edd2fffe1d75dc71b3604e41b5dfeb74af5fb7be/sdk/program/src/bpf_loader_upgradeable.rs#L82
On top of that, you have the base program account, which is 36 bytes: https://github.com/anza-xyz/agave/blob/edd2fffe1d75dc71b3604e41b5dfeb74af5fb7be/sdk/program/src/bpf_loader_upgradeable.rs#L72
Solana programs only store bytecode, so there's no account data included at all. PDAs are separate accounts, so they are not included in the program size.
And I'm not sure what you mean by "arguments", but maybe you mean instruction data? Those are also not stored in the program, they come from the transaction.