The optimality of Grover's algorithm doesn't in any way suggest that the upper bound on speedup is quadratic. That result only applies to one very particular class of problems: unstructured (oracle) search problems. There are other oracle problems for which the speedup is known to be exponential. For non-oracle problems the situation isn't yet clear, although many people believe the speedup will be exponential. That will be true if factoring isn't in BPP, for instance.