I read in Stroustrup's book that polymorphic function call is within 25% more expensive than an ordinary function call.
This might be the case (probably a ball-park figure), but it's not that important. Even if a virtual function call is 25% more expensive than an ordinary function call, this is still just the cost of the function call, not the cost of the function execution. I just wanted to make that precision. The cost of the function call will often be much smaller than the cost of the function execution. But watch out, it's not always insignificant either, if you abuse polymorphism and have it for all functions, even the most trivial ones, then that extra overhead can add up very quickly.
Most importantly though, virtual function calls have to be dispatched through a function pointer, and function pointers mean no inlining, or any form of cross-contextual optimization. That is usually where most of the slow down will come from, i.e., you should not be comparing a "virtual function call" to a "function call", but rather a "virtual function call" to a "statically analyzable, potentially inline-able, lto-optimizable function call".
Is it worth it to avoid polymorphism in order to gain performance?
In C++, and in programming in general, whenever there's a price, there's a gain, and whenever there's a gain, there's a price. It's that simple. Dynamic polymorphism comes with a price in the form of (1) overhead on function calls, (2) blocking static analysis and optimizations, (3) often requiring heap-allocated objects and extra indirection (pointers, references, etc.), and so on, just to name a few. However, you also make substantial gains in the form of (1) run-time flexibility, (2) scalability (disjoint unions of problem domains), (3) reduced compilation times, (4) less code repetition, and so on.
The point is, if you want the things that polymorphism buys you, then you should use it. But if you don't need those things (and you'd be surprised how often you don't need those things), then you shouldn't pay an unnecessary price for it. It's that simple.
For more details on the alternatives and trade-offs, I suggest this article.