You should use a keyhole contour, but also consider the integral
$$\oint_C dz \frac{\log^3{z}}{z^2-z+1}$$
Evaluating this contour integral, it will turn out (proof left to reader) that the integrals along the circular arcs out to infinity and down to zero near the origin vanish. That leaves the integrals up and back along the real line:
$$\oint_C dz \frac{\log^3{z}}{z^2-z+1} = \int_0^{\infty} dx \frac{\log^3{x}}{x^2-x+1} - \int_0^{\infty} dx \frac{(\log{x}+i 2 \pi)^3}{x^2-x+1} $$
Combine the expression on the right and get
$$\oint_C dz \frac{\log^3{z}}{z^2-z+1} = i \left [-6 \pi \int_0^{\infty} dx \frac{\log^2{x}}{x^2-x+1} + 8 \pi^3 \int_0^{\infty} dx \frac{1}{x^2-x+1}\right ] \\- 4 \pi^2 \int_0^{\infty} dx \frac{\log{x}}{x^2-x+1}$$
Now set this equal to $i 2 \pi$ times the sum of the residues at the poles. The poles are at $z = e^{i \pi/3}$ and $z=e^{i 5 \pi/3}$. Note that I am not saying that the latter pole is at $z=e^{-i \pi/3}$ because that would be inconsistent with the branch I chose in defining the argument of the values just below the real line to be $2 \pi$.
The residues are, at $z = e^{i \pi/3}$:
$$\frac{-i \pi^3/27}{2 e^{i \pi/3}-1}$$
and at $z=e^{i 5 \pi/3}$:
$$\frac{-i 125 \pi^3/27}{2 e^{i 5\pi/3}-1}$$
The contour integral is then $i 2 \pi$ times the sum of these residues:
$$\oint_C dz \frac{\log^3{z}}{z^2-z+1} = i 2 \pi \frac{124 \pi^3}{27 \sqrt{3}}$$
The real part is zero, which makes sense in light of the 1st line in your post. For the imaginary part, however, we have two integrals, one of which we want, the other of which is in our way and we have to determine. Fortunately, the evaluation follows exactly the same pattern as above, for an even simpler integral:
$$\oint_C dz \frac{\log{z}}{z^2-z+1}$$
which, when analyzed as above, spawns
$$\int_0^{\infty} dx \frac{1}{x^2-x+1} = \frac{4 \pi}{3 \sqrt{3}}$$
I leave it to the reader to verify this. The problem is then a simple one in algebra and arithmetic which I also leave to the reader. I get
$$\int_0^{\infty} dx \frac{\log^2{x}}{x^2-x+1} = \frac{20 \pi^3}{81 \sqrt{3}}$$
which implies that
$$\int_0^{1} dx \frac{\log^2{x}}{x^2-x+1} = \frac{10 \pi^3}{81 \sqrt{3}}$$
ADDENDUM
I realize that I didn't fully answer the OP's question. You do not want to use semicircular contours for integrals of the form
$$\int_0^{\infty} dx\: f(x)$$
when $f$ is not even. The reason for this is that the integral over the negative real line is not the same that the integral over the positive real line. For example, let's try again to attack the integral
$$\int_0^{\infty} dx \frac{1}{x^2-x+1}$$
in this manner. This is emphatically not the same as
$$\int_{-\infty}^{\infty} dx \frac{1}{x^2-x+1}$$
which is what would result from a semicircular contour. Such problems are not alleviated by avoiding branch points at the origin. In this case, the trick of using a keyhole contour on the integral
$$\oint_C dz \: f(z) \, \log{z}$$
works best, so long as you are careful about using a consistent branch of the log as I demonstrated above. In some cases, such as
$$\int_0^{\infty} \frac{dx}{x^3+1}$$
you can get away with a wedge contour instead of a keyhole. This is because the denominator is invariant upon rotation by $2 \pi/3$.
ADDENDUM II
I just realized that I solved a very similar problem here.
Integrals of the form
$$\int_{-\infty}^\infty \frac{p(x)}{\cosh x}\,dx,$$
where $p$ is a polynomial can be evaluated by shifting the contour of integration to a line $\operatorname{Im} z \equiv c$. We first check that the integrals over the vertical segments connecting the two lines tend to $0$ as the real part tends to $\pm\infty$:
$$\lvert \cosh (x+iy)\rvert^2 = \lvert \cosh x\cos y + i \sinh x\sin y\rvert^2 = \sinh^2 x + \cos^2 y,$$
so the integrand decays exponentially and
$$\left\lvert \int_{R}^{R + ic} \frac{p(z)}{\cosh z}\,dz\right\rvert
\leqslant \frac{K\,c}{\sinh R}\left(R^2+c^2\right)^{\deg p/2} \xrightarrow{R\to \pm\infty} 0.$$
Since $\cosh \left(z+\pi i\right) = -\cosh z$, and the only singularity of the integrand between $\mathbb{R}$ and $\mathbb{R}+\pi i$ is a simple pole at $\frac{\pi i}{2}$ (unless $p$ has a zero there, but then we can regard it as a simple pole with residue $0$) with the residue
$$\operatorname{Res}\left(\frac{p(z)}{\cosh z};\, \frac{\pi i}{2}\right) = \frac{p\left(\frac{\pi i}{2}\right)}{\cosh' \frac{\pi i}{2}} = \frac{p\left(\frac{\pi i}{2}\right)}{\sinh \frac{\pi i}{2}} = \frac{p\left(\frac{\pi i}{2}\right)}{i},$$
the residue theorem yields
$$\begin{align}
\int_{-\infty}^\infty \frac{p(x)}{\cosh x}\,dx
&= 2\pi\, p\left(\frac{\pi i}{2}\right) + \int_{\pi i-\infty}^{\pi i+\infty} \frac{p(z)}{\cosh z}\,dz\\
&= 2\pi\, p\left(\frac{\pi i}{2}\right) - \int_{-\infty}^\infty \frac{p(x+\pi i)}{\cosh x}\,dx\\
&= 2\pi\, p\left(\frac{\pi i}{2}\right) - \sum_{k=0}^{\deg p} \frac{(\pi i)^k}{k!}\int_{-\infty}^\infty \frac{p^{(k)}(x)}{\cosh x}\,dx.\tag{1}
\end{align}$$
Since $\cosh$ is even, only even powers of $x$ contribute to the integrals, hence we can from the beginning assume that $p$ is an even polynomial, and need only consider the derivatives of even order.
For a constant polynomial, $(1)$ yields
$$\int_{-\infty}^\infty \frac{dx}{\cosh x} = 2\pi - \int_{-\infty}^\infty \frac{dx}{\cosh x}\Rightarrow \int_{-\infty}^\infty \frac{dx}{\cosh x} = \pi.$$
For $p(z) = z^2$, we obtain
$$\begin{align}
\int_{-\infty}^\infty \frac{x^2}{\cosh x}\,dx &= 2\pi \left(\frac{\pi i}{2}\right)^2 - \int_{-\infty}^\infty \frac{x^2}{\cosh x}\,dx - (\pi i)^2\int_{-\infty}^\infty \frac{dx}{\cosh x}\\
&= - \frac{\pi^3}{2} - \int_{-\infty}^\infty \frac{x^2}{\cosh x}\,dx + \pi^3,
\end{align}$$
which becomes
$$\int_{-\infty}^\infty \frac{x^2}{\cosh x}\,dx = \frac{\pi^3}{4}.$$
Best Answer
This integral may be evaluated using the residue theorem. That said, the evaluation is very subtle and requires a bit of carrying around diverging quantities that cancel. Also, the contour of integration in this case should have a detour around the removable singularity. We proceed as follows.
Consider the contour integral
$$\oint_C dz \frac{\log^3{z}}{(z^2-1)^2} $$
where $C$ is the following contour:
where the bumps about the removable singularity at $z=1$ are semicircles of radius $\epsilon$ and the outer circle has a radius $R$. We parametrize the contour to evaluate the contour integral; accordingly, the contour integral is equal to
$$\int_{\epsilon}^{1-\epsilon} dx \frac{\log^3{x}}{(1-x^2)^2} + i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{\log^3{\left (1+\epsilon e^{i \phi} \right )}}{\left ( \left (1+\epsilon e^{i \phi} \right )^2-1 \right )^2} \\ + \int_{1+\epsilon}^{R} dx \frac{\log^3{x}}{(x^2-1)^2} + i R \int_0^{2 \pi} d\theta \, e^{i \theta} \frac{\log^3{\left ( R e^{i \theta} \right )}}{\left ( R^2 e^{i 2 \theta} \right )}\\ + \int_R^{1+\epsilon} dx \frac{\left (\log{x}+i 2 \pi \right)^3}{(x^2-1)^2}+ i \epsilon \int_{2 \pi}^{\pi} d\phi \, e^{i \phi} \frac{\left (\log{\left (1+\epsilon e^{i \phi} \right )}+i 2 \pi \right )^3}{\left ( \left (1+\epsilon e^{i \phi} \right )^2-1 \right )^2} \\+ \int_{1-\epsilon}^{\epsilon} dx \frac{(\log{x}+i 2 \pi)^3}{(1-x^2)^2} + i \epsilon \int_{2 \pi}^0 d\phi\, e^{i \phi} \frac{\log^3{\left ( \epsilon e^{i \phi} \right )}}{\left ( \epsilon^2 e^{i 2 \phi} \right )}$$
As $R \to \infty$, the fourth integral vanishes. As $\epsilon \to 0$, the second and eighth integrals vanish. In this limit, however, note that the second integrals opposite number, the sixth integral, does not vanish in this limit. Rather, the logs on the branch below the positive real axis have an $i 2 \pi$ added to them. This includes the log attached to the bump below the positive real axis, i.e., the sixth integral. This integral evaluates as follows for small $\epsilon$:
$$i \epsilon \int_{2 \pi}^{\pi} d\phi \, e^{i \phi} \frac{\left (\log{\left (1+\epsilon e^{i \phi} \right )}+i 2 \pi \right )^3}{\left ( \left (1+\epsilon e^{i \phi} \right )^2-1 \right )^2} = -i \frac{4 \pi^3}{\epsilon} + (2 \pi^4 + i 3 \pi^3 ) + O(\epsilon)$$
Note that in the limit as $\epsilon \to 0$, the integral leave us with a diverging term and a constant term. We will need these.
The first, third, fifth, and seventh integrals (those integrals above and below the real axis) combine to form the following:
$$-i 6 \pi \int_0^{\infty} dx \frac{\log^2{x}}{(1-x^2)^2} + 12 \pi^2 PV \int_0^{\infty} dx \frac{\log{x}}{(1-x^2)^2} \\ + i 8 \pi^3 \left [\int_0^{1-\epsilon} \frac{dx}{(1-x^2)^2} + \int_{1+\epsilon}^{\infty} \frac{dx}{(x^2-1)^2} \right ]$$
In the second integral above, the $PV$ denotes a Cauchy principal value of the integral, which has a simple pole in its integrand. For the last pair of integrals, we arrange them as we would a Cauchy principal value while acknowledging that the Cauchy P.V. does not exist because of the double pole at $x=1$. We will evaluate this pair of integrals in the limit as $\epsilon \to 0$ and will produce another singularity.
$$\begin{align} \int_0^{1-\epsilon} \frac{dx}{(1-x^2)^2} &= \int_0^{\arcsin{(1-\epsilon)}} d\theta \, \sec^3{\theta} \\ &= \left [ \frac12 \sec{\theta} \tan{\theta} + \frac12 \log{(\sec{\theta} + \tan{\theta})} \right ]_0^{\arcsin{(1-\epsilon)}} \\ &= \frac12 \frac{1-\epsilon}{\epsilon (2-\epsilon)} + \frac14 \log{\left ( \frac{2-\epsilon}{\epsilon} \right )} \end{align} $$
Similarly, the reader should be able to show that
$$\int_{1+\epsilon}^{\infty} \frac{dx}{(x^2-1)^2} = \frac12 \frac{1+\epsilon}{\epsilon (2+\epsilon)} - \frac14 \log{\left ( \frac{2+\epsilon}{\epsilon} \right )}$$
Adding these two pieces and expanding about $\epsilon = 0$, we get an asymptotic expression for the pair of integrals that is not quite a Cauchy principal value:
$$\int_0^{1-\epsilon} \frac{dx}{(1-x^2)^2} + \int_{1+\epsilon}^{\infty} \frac{dx}{(x^2-1)^2} = \frac1{2 \epsilon} + O(\epsilon) $$
That is, there is no constant term in the above expression; rather, there is only a divergent term and vanishing terms.
Putting this all together, we get an expression for the contour integral as $\epsilon \to 0$ and $R \to \infty$:
$$\oint_C dz \frac{\log^3{z}}{(z^2-1)^2} = -i 6 \pi \int_0^{\infty} dx \frac{\log^2{x}}{(1-x^2)^2} + 12 \pi^2 PV \int_0^{\infty} dx \frac{\log{x}}{(1-x^2)^2} \\ + i \frac{4 \pi^3}{\epsilon} -i \frac{4 \pi^3}{\epsilon} + (2 \pi^4 + i 3 \pi^3 ) + O(\epsilon)$$
The divergent terms cancel and we finally get, for the contour integral,
$$\oint_C dz \frac{\log^3{z}}{(z^2-1)^2} = -i 6 \pi \int_0^{\infty} dx \frac{\log^2{x}}{(1-x^2)^2} + 12 \pi^2 PV \int_0^{\infty} dx \frac{\log{x}}{(1-x^2)^2} + (2 \pi^4 + i 3 \pi^3 )$$
Now, by the residue theorem, the contour integral is also equal to $i 2 \pi$ times the residue at the pole $z=-1=e^{i \pi}$. I will leave the evaluation of this residue to the reader; keep in mind that there is a double pole at $z=e^{i \pi}$. Thus, by the residue theorem,
$$-i 6 \pi \int_0^{\infty} dx \frac{\log^2{x}}{(1-x^2)^2} + 12 \pi^2 PV \int_0^{\infty} dx \frac{\log{x}}{(1-x^2)^2} + (2 \pi^4 + i 3 \pi^3 ) = \frac{\pi^4}{2} + i \frac{3 \pi^3}{2}$$
Equating real and imaginary parts, we finally get the result for the integral we seek, plus a bonus:
So while this was a bit involved, I hope the reader gets all of the subtleties in evaluating integrals with removable singularities and higher powers of log.