Fix more performance issues found by cppcheck

Here some more patches to fix performance issues found by cppcheck. This should now cover - together with wip-da-sca-cppcheck-performance - the following issues:

- use empty() instead of size() to check for emptiness
- dont't pass string::c_str() to string arguments
- prevent useless value assignment
- pass some objects by reference instead of by-value