I am looking to buy an electric violin and already own an electric bass and a keyboard. I was wondering if a guitar effects pedal would work with any of these instruments.
Definitely. "Guitar" effects have almost never been used only for guitar. Keyboard and bass players in particular have long used effect pedals.
Effects pedals have also been used live and in studios to process all kinds of sources, including vocals. Many times processing some sources like vocals require adapters and level and impedance matching to make the signal compatible with what the pedal was designed for.
Pretty much anything with a 1/4" mono output can be used with effect pedals, including acoustic instruments with pickups (guitar, violin, banjo, etc.), basses of all kinds, synthesizers, electric pianos, clavinets, and other keyboards.
Some pedals designed for guitar, especially the more affordable ones, will have a reduced frequency response, so the lowest lows and highest highs of some instruments might be diminished. Sometimes that is good and other times not. Effects designed for bass are typically full-range and can work for guitar also.
Note that all of the instruments mentioned above have also been amplified using guitar amolifiers, over the years. So that's another tool you can use in sound shaping.
If you have the right inputs (1/4 mono jack) it will work
The sound you'll get mostly depends on the type of pedal that is being used (delay and reverbs sound good on all instruments whereas most distortion pedals are prone to feedback and artifacts when played with other instruments
In the end it's a matter of taste - experiment and find the tone you like