If a word is too long and it does not have a hyphenation pattern, the TeX engine does not know where to insert a break. You can force it by adding a minuscule amount of glue in-between the letters.
TeX will then be able to insert a break. How much glue? As it happens even 1sp which is the smallest unit can do the trick (there are 65 536 scaled points in a point, which is less than the wavelength of visible light). All we need is a scanner to scan through the letters. Here is a minimal:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\parindent0pt
\makeatletter
\def\scanfunction#1{#1}
\let\tempa\@empty
\def\scan@letters#1#2{%
\g@addto@macro{\tempa}{#1\hskip 0pt plus 1sp minus 1sp}%
\ifx#2\@empty
\else
\expandafter\scan@letters
\fi
#2}
\def\scan#1{%
\scan@letters #1\@empty
}
\scan{aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
\tempa
\lipsum[1]
\end{document}
Edit: egreg at chat brought to my attention that even hskip 0pt will also work.